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 r = Renderer::new(Some(Highlighter::new()));
let _ = r.markdown_str("# Hello", false, None, deadline);
let _ = r.page(&Markup::Markdown("# Hello".to_string()), &LinksContext {
    base_url: None,
    nofollow: None,
    own_crate_name: None,
    link_own_crate_to_crates_io: true,
    link_fixer: None,
}, 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§