Crate dmos

Source
Expand description

A djot renderer with advanced features.

DMOS builds on the jotdown djot parser and its default HTML renderer, but adds the following features:

  • Syntax highlighting (if enabled, see feature flags)
  • Table of contents generation with various options
  • Adding anchors to section headings
  • Convenient extraction of document title
  • Extraction of document metadata from specific attributes

The main entry points are the module’s render(), title(), toc(), and meta() functions. See RenderOpts and TocOpts for options controlling the output. For more low-level customizations, the individual renderers could also be used, but make sure to use the re-exported jotdown module when working with them.

§Feature flags

  • syntect (default): syntax highlighting for code block based on syntect
  • inkjet: syntax highlighting based on inkjet

Re-exports§

pub use jotdown;

Structs§

DocumentRenderer
Implementation of jotdown::Render that renders documents with advanced features.
MetaOpts
Options controlling the metadata generation
MetaRenderer
Implementation of jotdown::Render that outputs all “dmos:” attributes in a format suitable for consumption with env(1).
RenderOpts
Options controlling the document generation.
TitleRenderer
Implementation of jotdown::Render that only writes a document’s plain-text title.
TocOpts
Options controlling the table-of-contents generation.
TocRenderer
Implementation of jotdown::Render that renders a document’s table of contents as HTML.

Enums§

Error
MetaFormat

Functions§

meta
Renders a representation of metadata, based on specific djot attributes.
render
Renders a djot document to HTML.
title
Returns the plain-text title of the document.
toc
Renders a table of contents for the document as HTML.