Skip to main content

parse_markdown

Function parse_markdown 

Source
pub fn parse_markdown(
    source_text: &str,
    source_path: Option<String>,
) -> Result<ParsedMarkdown, MarkdownParseError>
Expand description

Split ManT’s optional leading tldr directive from the Markdown document.

The directive must be the first non-empty construct and uses the existing tldr-pages Markdown dialect. The remaining source is parsed independently, so its first H1 remains document metadata rather than part of the preface.

§Errors

Returns MarkdownParseError for an unterminated directive or malformed embedded tldr page.