[][src]Module mdbook::utils

Modules

fs

Functions

collapse_whitespace

Replaces multiple consecutive whitespace characters with a single space character.

id_from_content

Generate an ID for use with anchors which is derived from a "normalised" string.

log_backtrace

Prints a "backtrace" of some Error.

new_cmark_parser
normalize_id

Convert the given string to a valid HTML element ID. The only restriction is that the ID must not contain any ASCII whitespace.

render_markdown

Wrapper around the pulldown-cmark parser for rendering markdown to HTML.

render_markdown_with_path
take_anchored_lines

Take anchored lines from a string. Lines containing anchor are ignored.

take_lines

Take a range of lines from a string.

take_rustdoc_include_anchored_lines

Keep lines between the anchor comments specified as-is. For any lines not between the anchors, include them but use # at the beginning. This will hide the lines from initial display but include them when expanding the code snippet or testing with rustdoc.

take_rustdoc_include_lines

Keep lines contained within the range specified as-is. For any lines not in the range, include them but use # at the beginning. This will hide the lines from initial display but include them when expanding the code snippet or testing with rustdoc.