Module rustdoc::html::markdown[][src]

Markdown formatting for rustdoc

This module implements markdown formatting through the pulldown-cmark rust-library. This module exposes all of the functionality through a unit-struct, Markdown, which has an implementation of fmt::Display. Example usage:

#![feature(rustc_private)]

use rustdoc::html::markdown::Markdown;

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

Structs

CodeBlocks

Adds syntax highlighting and playground Run buttons to rust code blocks.

Footnotes

Moves all footnote definitions to the end and add back links to the references.

HeadingLinks

Make headings links with anchor ids and build up TOC.

LangString
LinkReplacer

Make headings links with anchor ids and build up TOC.

Markdown

A unit struct which has the fmt::Display trait implemented. When formatted, this struct will emit the HTML corresponding to the rendered version of the contained markdown string. The second parameter is a list of link replacements

MarkdownHtml

A unit struct like Markdown, that renders the markdown escaping HTML tags.

MarkdownSummaryLine

A unit struct like Markdown, that renders only the first paragraph.

MarkdownWithToc

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

SummaryLine

Extracts just the first paragraph.

Enums

Line

Controls whether a line will be hidden or shown in HTML output.

Constants

PLAYGROUND

Functions

check_if_allowed_tag
find_testable_code
map_line
markdown_links
plain_summary_line
slugify

Convert chars from a title for an id.