Module outline::parser::md

source ·
Expand description

The parser for Markdown based literate programming.

This includes some extensions to support some of the more advanced features of this tool.

See examples/md/wc.c.md for an example of how to use this format with the default config, which is specified as follows:

  • Code lines are enclosed in fenced code blocks, using \``lang` as the fence.
  • A macro (named code block) separates the name from the language tag -, such as \``c - Name of the macro`. Note that the hyphen is surrounded by a single space on either side, even if there is no language tag.
  • The comment symbol is //, but they are rendered inline
    • Enabling the comments_as_aside option will render comments in an <aside> after the code block, which you may then style accordingly when the document is rendered.
  • Interpolation of is done such as @{a meta variable}.
  • Macros (named code blocks) are invoked by ==> Macro name. (note the period at the end)

As with all supported styles, all code blocks with the same name are concatenated, in the order they are found, and the “unnamed” block is used as the entry point when generating the output source file. Any code blocks with names which are not invoked will not appear in the compiled code.

Currently, the Markdown parser does not support code that is written to the compiled file, but not rendered in the documentation file.

Structs

The config for parsing a Markdown document

Enums

Errors that were encountered while parsing the HTML
Kinds of errors that can be encountered while parsing and restructuring the Markdown