Skip to main content

Crate socketry_markdown

Crate socketry_markdown 

Source
Expand description

Public API of socketry-markdown.

This module exposes primarily to_html(). It also exposes to_html_with_options() and to_mdast().

  • to_html() — safe way to transform (untrusted?) markdown into HTML
  • to_html_with_options() — like to_html but lets you configure how markdown is turned into HTML, such as allowing dangerous HTML or turning on/off different constructs (GFM, MDX, and the like)
  • to_mdast() — turn markdown into a syntax tree
  • Renderer — render AST nodes and fragments with a user-defined renderer
  • HTMLRenderer — render an AST node or fragment directly as HTML
  • MarkdownRenderer — render an AST node or fragment back to Markdown

§Features

  • default — nothing is enabled by default
  • log — enable logging (includes dep:log); you can show logs with RUST_LOG=debug
  • serde — enable serde to serialize ASTs and configuration (includes dep:serde)

Re-exports§

pub use markdown::to_markdown;
pub use markdown::to_markdown_with_options;
pub use markdown::IndentOptions;
pub use markdown::Options as MarkdownOptions;
pub use renderer::HTMLRenderer;
pub use renderer::MarkdownRenderer;
pub use renderer::Renderer;

Modules§

markdown
API.
mdast
markdown syntax tree: mdast.
message
renderer
Traits for rendering Markdown AST nodes.
unist
abstract syntax trees: unist.

Structs§

CompileOptions
Configuration that describes how to compile to HTML.
Constructs
Control which constructs are enabled.
Options
Configuration that describes how to parse from markdown and compile to HTML.
ParseOptions
Configuration that describes how to parse from markdown.

Enums§

LineEnding
Type of line endings in markdown.
MdxExpressionKind
Expression kind.
MdxSignal
Signal used as feedback when parsing MDX ESM/expressions.

Functions§

to_html
Turn markdown into HTML.
to_html_with_options
Turn markdown into HTML, with configuration.
to_mdast
Turn markdown into a syntax tree.

Type Aliases§

MdxEsmParse
Signature of a function that parses MDX ESM.
MdxExpressionParse
Signature of a function that parses MDX expressions.