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§

FilteredImage
Highlighter
Wrapper for a collection of Syntect syntaxes
LinksContext
Readme
Readme page from a repository
Renderer
Convert and filter markup

Enums§

Links
Markup
Describe format/syntax used in the string
NodeData
The different kinds of nodes in the DOM.

Traits§

ImageFilter
Callbacks for every image URL in the document

Functions§

is_badge_url
is_readme_filename
very_basic_asciidoc_to_markdown

Type Aliases§

ArcImageFilter
Handle
Reference to a DOM node.
LinkFixer