myst_parser._docs#

Code to use internally, for documentation.

1.  Module Contents#

1.1.  Classes#

StripUnsupportedLatex

Remove unsupported nodes from the doctree.

NumberSections

Number sections (html only)

MystConfigDirective

DocutilsCliHelpDirective

Directive to print the docutils CLI help.

DirectiveDoc

Load and document a directive.

MystWarningsDirective

Directive to print all known warnings.

MystExampleDirective

Directive to create an example, showing the source and output.

MystAdmonitionDirective

Directive to show a set of admonitions, in a tab set.

MystToHTMLDirective

Directive to convert MyST to HTML.

MystLexer

A custom lexer for MyST Markdown.

1.2.  Functions#

convert_opt

Convert an option function to a string.

1.3.  Data#

LOGGER

1.4.  API#

myst_parser._docs.LOGGER = None#
class myst_parser._docs.StripUnsupportedLatex(document, startnode=None)[source]#

Bases: sphinx.transforms.post_transforms.SphinxPostTransform

Remove unsupported nodes from the doctree.

Initialization

Initial setup for in-place document transforms.

default_priority = 900#
run()[source]#
class myst_parser._docs.NumberSections(document, startnode=None)[source]#

Bases: sphinx.transforms.post_transforms.SphinxPostTransform

Number sections (html only)

Initialization

Initial setup for in-place document transforms.

default_priority = 710#
formats = ('html',)#
run()[source]#
class myst_parser._docs.MystConfigDirective(name, arguments, options, content, lineno, content_offset, block_text, state, state_machine)[source]#

Bases: myst_parser._docs._ConfigBase

option_spec = None#
run()[source]#

Run the directive.

class myst_parser._docs.DocutilsCliHelpDirective(name, arguments, options, content, lineno, content_offset, block_text, state, state_machine)[source]#

Bases: sphinx.util.docutils.SphinxDirective

Directive to print the docutils CLI help.

Initialization

has_content = False#
required_arguments = 0#
optional_arguments = 0#
final_argument_whitespace = False#
run()[source]#

Run the directive.

class myst_parser._docs.DirectiveDoc(name, arguments, options, content, lineno, content_offset, block_text, state, state_machine)[source]#

Bases: sphinx.util.docutils.SphinxDirective

Load and document a directive.

Initialization

required_arguments = 1#
has_content = True#
run()[source]#

Run the directive.

myst_parser._docs.convert_opt(name, func)[source]#

Convert an option function to a string.

class myst_parser._docs.MystWarningsDirective(name, arguments, options, content, lineno, content_offset, block_text, state, state_machine)[source]#

Bases: sphinx.util.docutils.SphinxDirective

Directive to print all known warnings.

Initialization

has_content = False#
required_arguments = 0#
optional_arguments = 0#
final_argument_whitespace = False#
run()[source]#

Run the directive.

class myst_parser._docs.MystExampleDirective(name, arguments, options, content, lineno, content_offset, block_text, state, state_machine)[source]#

Bases: sphinx.util.docutils.SphinxDirective

Directive to create an example, showing the source and output.

Initialization

has_content = True#
option_spec = None#
run()[source]#

Run the directive.

class myst_parser._docs.MystAdmonitionDirective(name, arguments, options, content, lineno, content_offset, block_text, state, state_machine)[source]#

Bases: sphinx.util.docutils.SphinxDirective

Directive to show a set of admonitions, in a tab set.

Initialization

required_arguments = 1#
final_argument_whitespace = True#
run()[source]#

Run the directive.

class myst_parser._docs.MystToHTMLDirective(name, arguments, options, content, lineno, content_offset, block_text, state, state_machine)[source]#

Bases: sphinx.util.docutils.SphinxDirective

Directive to convert MyST to HTML.

Initialization

has_content = True#
optional_arguments = 1#
final_argument_whitespace = True#
option_spec = None#
run()[source]#

Run the directive.

class myst_parser._docs.MystLexer(**options)[source]#

Bases: pygments.lexers.markup.MarkdownLexer

A custom lexer for MyST Markdown.

Initialization

name = 'MyST'#
aliases = ['myst']#
filenames = ['*.myst']#
mimetypes = ['text/x-myst']#
tokens = None#