Overview of MyST Transforms plugins
MyST Transforms provides a suite of plugins to manipulate and clean the Abstract Syntax Tree (AST) of a document before rendering. Key transformations include:
- Admonitions: Adds headers (e.g., 'Note', 'Important') to callouts; can replace headers with the first bold paragraph.
- Blocks: Prevents nested blocks within a document.
- Blockquotes: Converts attributed blockquotes (single list items) into figures of
kind: quotewith the attribution as a caption. - Caption: Ensures figure captions are wrapped in paragraphs.
- Code: Audits code blocks for language specifications, provides defaults, and normalizes kernel-like specifiers (e.g.,
IPython3) topython. - CodeBlock: Preserves captions and references for code blocks located inside figures.
- Footnotes: Extracts footnote definitions into a reference object.
- HTML: Parses and replaces the contents of HTML nodes.
- HTML Ids: Generates valid HTML IDs for referenceable nodes (must start with a letter, no spaces or special characters).
- Images: Automatically populates missing image alt text using the caption.
- Keys: Assigns unique identifiers to nodes for rendering and tracking (non-persistent across builds).
- Math: Uses KaTeX for rendering and generates math-related errors/warnings.
- Math Label: Strips
\labeland simple equation environments from LaTeX and places them directly in the AST. - MyST Cleanup: Removes wrapper nodes like
mystDirectiveandmystRoleand lifts children nodes. - Targets: Propagates targets (e.g.,
(my-id)=) to the subsequent node and adds HTML-friendly identifiers to headings.