Crate comrak
A 100% CommonMark and GFM compatible Markdown parser.
Source repository and detailed README is at https://github.com/kivikakk/comrak.
You can use comrak::markdown_to_html directly:
use ;
assert_eq!;
Or you can parse the input into an AST yourself, manipulate it, and then use your desired formatter:
use ;
use ;
#
Modules
- adapters Adapter traits for plugins.
- arena_tree Included from https://github.com/SimonSapin/rust-forest/blob/5783c8be8680b84c0438638bdee07d4e4aca40ac/arena-tree/lib.rs. MIT license (per Cargo.toml).
- html The HTML renderer for the CommonMark AST, as well as helper functions.
- nodes The CommonMark AST.
- plugins Plugins for enhancing the default implementation of comrak can be defined in this module.
Functions
- markdown_to_commonmark Render Markdown back to CommonMark.
- markdown_to_commonmark_xml Render Markdown to CommonMark XML. See https://github.com/commonmark/commonmark-spec/blob/master/CommonMark.dtd.
- markdown_to_commonmark_xml_with_plugins Render Markdown to CommonMark XML using plugins. See https://github.com/commonmark/commonmark-spec/blob/master/CommonMark.dtd.
- markdown_to_html Render Markdown to HTML.
- markdown_to_html_with_plugins Render Markdown to HTML using plugins.
- version Return the version of the crate.
Type Aliases
-
ComrakExtensionOptions
Legacy naming of
ExtensionOptions -
ComrakOptions
Legacy naming of
Options -
ComrakParseOptions
Legacy naming of
ParseOptions -
ComrakPlugins
Legacy naming of
Plugins -
ComrakRenderOptions
Legacy naming of
RenderOptions -
ComrakRenderPlugins
Legacy naming of
RenderPlugins