Module rustdoc::html::markdownUnstable [-] [+] [src]

Markdown formatting for rustdoc

This module implements markdown formatting through the hoedown C-library (bundled into the rust runtime). This module self-contains the C bindings and necessary legwork to render markdown, and exposes all of the functionality through a unit-struct, Markdown, which has an implementation of fmt::String. Example usage:

extern crate rustdoc; fn main() { use rustdoc::html::markdown::Markdown; let s = "My *markdown* _text_"; let html = format!("{}", Markdown(s)); // ... something using html }
use rustdoc::html::markdown::Markdown;

let s = "My *markdown* _text_";
let html = format!("{}", Markdown(s));
// ... something using html

Structs

Markdown

A unit struct which has the fmt::String trait implemented. When formatted, this struct will emit the HTML corresponding to the rendered version of the contained markdown string.

MarkdownWithToc

A unit struct like Markdown, that renders the markdown with a table of contents.

Statics

PLAYGROUND_KRATE

Functions

find_testable_code
plain_summary_line
render
reset_headers

By default this markdown renderer generates anchors for each header in the rendered document. The anchor name is the contents of the header separated by hyphens, and a thread-local map is used to disambiguate among duplicate headers (numbers are appended).