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#

align

figwidth_value

1.3.  API#

myst_parser.sphinx_ext.directives.align(argument)[source]#
myst_parser.sphinx_ext.directives.figwidth_value(argument)[source]#
class myst_parser.sphinx_ext.directives.SubstitutionReferenceRole[source]#

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]][source]#
class myst_parser.sphinx_ext.directives.FigureMarkdown(name, arguments, options, content, lineno, content_offset, block_text, state, state_machine)[source]#

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][source]#
figure_error(message)[source]#

A warning for reporting an invalid figure.