myst_parser.mdit_to_docutils.sphinx_#

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

1.  Module Contents#

1.1.  Classes#

SphinxRenderer

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 = 'getLogger(...)'#
class myst_parser.mdit_to_docutils.sphinx_.SphinxRenderer(parser: markdown_it.main.MarkdownIt)[源代码]#

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.

Initialization

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][源代码]#
render_math_block_label(token: markdown_it.tree.SyntaxTreeNode) None[源代码]#

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

render_amsmath(token: markdown_it.tree.SyntaxTreeNode) None[源代码]#

Renderer for the amsmath extension.

add_math_target(node: docutils.nodes.math_block) docutils.nodes.target[源代码]#