plugin: The Mdformat Plugin Entry Point#

Implements the interface that mdformat.plugins discovers through this package’s entry point: update_mdit() enables the MyST parsers on the MarkdownIt engine, while RENDERERS and POSTPROCESSORS expose the registries that mdformat consults while rendering.

The Mdformat Plugin Entry Point.

Implements the interface that mdformat.plugins discovers through this package’s entry point: update_mdit() enables the MyST parsers on the MarkdownIt engine, while RENDERERS and POSTPROCESSORS expose the registries that mdformat consults while rendering.

myform.plugin.update_mdit(mdit: MarkdownIt) → None#

Update the given MarkdownIt instance to support MyST syntax.

myform.plugin.add_cli_argument_group(group: _ArgumentGroup) → None#

Register the plugin’s CLI options (mirrored from [plugin.myst] TOML keys).

Delegated to the MystOptions schema so the CLI flags, TOML keys, validation, and JSON Schema all stay generated from one source of truth.

myform.plugin.CHANGES_AST = True#

this plugin rewrites the token stream into MyST nodes (roles, directives, targets, comments) that are not valid CommonMark, so mdformat’s is_md_equal AST-preservation check does not apply and is skipped. Correctness is guarded instead by this package’s own round-trip and double-format idempotency tests. (The _null_render HTML rules above remain as belt-and-braces for any path that still renders directive tokens to HTML.)

Type:

Declared honestly

myform.plugin.RENDERERS = {'blockquote': <function Renderer.render_blockquote>, 'math_block': <function Renderer.render_math_block>, 'math_block_label': <function Renderer.render_math_block_label>, 'math_inline': <function Renderer.render_math_inline>, 'myst_block_break': <function Renderer.render_myst_block_break>, 'myst_directive': <function Renderer.render_myst_directive>, 'myst_ignored': <function Renderer.render_myst_ignored>, 'myst_line_comment': <function Renderer.render_myst_line_comment>, 'myst_role': <function Renderer.render_myst_role>, 'myst_target': <function Renderer.render_myst_target>, 'root': <function Renderer.render_root>, 'table': <bound method TableRenderer.render of <class 'myform.Tables.TableRenderer'>>, 'td': <function render_table_cell>, 'th': <function render_table_cell>}#

Node-type -> renderer mapping consumed by mdformat.