myst_parser.warnings_#

Central handling of warnings for the myst extension.

1.  Module Contents#

1.1.  Classes#

MystWarnings

MyST warning types.

1.2.  Functions#

create_warning

Generate a warning, logging if it is necessary.

1.3.  API#

class myst_parser.warnings_.MystWarnings[source]#

Bases: enum.Enum

MyST warning types.

DEPRECATED = 'deprecated'#

Deprecated usage.

NOT_SUPPORTED = 'not_supported'#

Functionality that is not yet supported in docutils.

RENDER_METHOD = 'render'#

The render method is not implemented.

MD_TOPMATTER = 'topmatter'#

Issue reading front-matter.

MD_DEF_DUPE = 'duplicate_def'#

Duplicate Markdown reference definition.

MD_FOOTNOTE_DUPE = 'footnote'#

Duplicate Markdown footnote definition.

MD_FOOTNOTE_MISSING = 'footnote'#

Missing Markdown footnote definition.

MD_HEADING_NON_CONSECUTIVE = 'header'#

Non-consecutive heading levels.

DIRECTIVE_PARSING = 'directive_parse'#

Issue parsing directive.

DIRECTIVE_OPTION = 'directive_option'#

Issue parsing directive options.

DIRECTIVE_BODY = 'directive_body'#

Issue parsing directive body.

UNKNOWN_DIRECTIVE = 'directive_unknown'#

Unknown directive.

UNKNOWN_ROLE = 'role_unknown'#

Unknown role.

XREF_AMBIGUOUS = 'xref_ambiguous'#

Multiple targets were found for a cross-reference.

XREF_MISSING = 'xref_missing'#

A target was not found for a cross-reference.

INV_LOAD = 'inv_retrieval'#

Failure to retrieve or load an inventory.

IREF_MISSING = 'iref_missing'#

A target was not found for an inventory reference.

IREF_AMBIGUOUS = 'iref_ambiguous'#

Multiple targets were found for an inventory reference.

LEGACY_DOMAIN = 'domains'#

A legacy domain found, which does not support resolve_any_xref.

HEADING_SLUG = 'heading_slug'#

An error occured computing a heading slug.

STRIKETHROUGH = 'strikethrough'#

Strikethrough warning, since only implemented in HTML.

HTML_PARSE = 'html'#

HTML could not be parsed.

INVALID_ATTRIBUTE = 'attribute'#

Invalid attribute value.

SUBSTITUTION = 'substitution'#

Substitution could not be resolved.

myst_parser.warnings_.create_warning(document: docutils.nodes.document, message: str, subtype: myst_parser.warnings_.MystWarnings, *, line: int | None = None, append_to: docutils.nodes.Element | None = None) docutils.nodes.system_message | None[source]#

Generate a warning, logging if it is necessary.

If the warning type is listed in the suppress_warnings configuration, then None will be returned and no warning logged.