Crate render_readme

source ·
Expand description

Render Markdown or reStructuredText with syntax highlighting and image filtering similar to GitHub’s

use render_readme::*;
let deadline = std::time::Instant::now() + std::time::Duration::from_secs(3);
let links_settings = LinksContext {
    base_url: None,
    nofollow: Links::Trusted,
    own_crate_name: None,
    link_own_crate_to_crates_io: true,
    link_fixer: None,
};
let r = Renderer::new(Some(Highlighter::new()));
let _ = r.markdown_str("# Hello", false, &links_settings, deadline);
let _ = r.page(&Markup::Markdown("# Hello".to_string()), &links_settings, true, deadline);

Markdown is implemented natively in Rust. RST rendering requires rst2html installed.

Structs§

Enums§

  • Describe format/syntax used in the string
  • The different kinds of nodes in the DOM.

Traits§

  • Callbacks for every image URL in the document

Functions§

Type Aliases§