myst_parser.sphinx_ext.directives#

MyST specific directives

1.  Module Contents#

1.1.  Classes#

SubstitutionReferenceRole

Implement substitution references as a role.

FigureMarkdown

Directive for creating a figure with Markdown compatible syntax.

1.2.  Functions#

1.3.  API#

myst_parser.sphinx_ext.directives.align(argument)[源代码]#
myst_parser.sphinx_ext.directives.figwidth_value(argument)[源代码]#
class myst_parser.sphinx_ext.directives.SubstitutionReferenceRole[源代码]#

Bases: sphinx.util.docutils.SphinxRole

Implement substitution references as a role.

Note, in docutils/parsers/rst/roles.py this is left unimplemented.

run() tuple[list[docutils.nodes.Node], list[docutils.nodes.system_message]][源代码]#
class myst_parser.sphinx_ext.directives.FigureMarkdown(name, arguments, options, content, lineno, content_offset, block_text, state, state_machine)[源代码]#

Bases: sphinx.util.docutils.SphinxDirective

Directive for creating a figure with Markdown compatible syntax.

Example:

:::{figure-md} target
<img src="img/fun-fish.png" alt="fishy" class="bg-primary mb-1" width="200px">

This is a caption in **Markdown**
:::

Initialization

required_arguments = 0#
optional_arguments = 1#
final_argument_whitespace = True#
has_content = True#
option_spec = None#
run() list[docutils.nodes.Node][源代码]#
figure_error(message)[源代码]#

A warning for reporting an invalid figure.