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§
- Wrapper for a collection of Syntect syntaxes
- Readme page from a repository
- Convert and filter markup
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§
- Reference to a DOM node.