Modes
The four ways polytypo reads a document: text, html, markdown and yaml, and what each treats as prose.
- Modes The four ways polytypo reads a document, what each one treats as prose, and how to choose between them.
- Text mode The default mode. The whole string is prose, there is no parser and no skip list, so everything in it is typeset.
- HTML mode Typeset the prose in an HTML document or fragment while tags, attributes, code, scripts and character references come back byte for byte.
- Markdown mode Typeset the prose of a CommonMark or MDX document, leaving code, links, HTML and frontmatter exactly as written.
- Markdown dialects Why markdown mode requires an explicit dialect, what commonmark and mdx each mean, and what happens when the document does not parse.
- Markdown skip list Exactly which parts of a Markdown document markdown mode leaves untouched, and which parts it typesets.
- Frontmatter How markdown mode treats a YAML or TOML frontmatter block, how to typeset named fields with frontmatterKeys, and how the block is located.
- MDX How markdown mode handles MDX: JSX elements and attributes, expressions, ESM statements, and documents that fail to parse.
- YAML mode Typeset the prose values of named keys in a YAML file, with a specified scan instead of a parser, and everything else returned byte for byte.
- YAML keys How the keys option selects values in yaml mode: exact matching, any depth, no paths or globs, and which lines the scan reads as keys.
- Quoting and scalar forms Which YAML value forms yaml mode typesets, which it leaves untouched, and why a colon or hash inside a plain scalar is treated as a boundary.