Convert Markdown-it tokens to docutils nodes, including sphinx specific elements.

1.  Module Contents#

1.1.  Classes#


A markdown-it-py renderer to populate (in-place) a docutils.document AST.

1.2.  Data#


1.3.  API#

myst_parser.mdit_to_docutils.sphinx_.LOGGER = None#
class myst_parser.mdit_to_docutils.sphinx_.SphinxRenderer(parser: markdown_it.main.MarkdownIt)[source]#

Bases: myst_parser.mdit_to_docutils.base.DocutilsRenderer

A markdown-it-py renderer to populate (in-place) a docutils.document AST.

This is sub-class of DocutilsRenderer that handles sphinx specific aspects, such as cross-referencing.


Load the renderer (called by MarkdownIt)

property sphinx_env: sphinx.environment.BuildEnvironment#

Render link token [text](link β€œtitle”), where the link has not been identified as an external URL.

get_inventory_matches(*, invs: str | None, domains: str | None, otypes: str | None, target: str | None) list[myst_parser.inventory.InvMatch][source]#
render_math_block_label(token: markdown_it.tree.SyntaxTreeNode) None[source]#

Render math with referencable labels, e.g. $a=1$ (label).

render_amsmath(token: markdown_it.tree.SyntaxTreeNode) None[source]#

Renderer for the amsmath extension.

add_math_target(node: docutils.nodes.math_block)[source]#