myst_parser.mdit_to_docutils.transforms#

Directives that can be applied to both Sphinx and docutils.

1.  Module Contents#

1.1.  Classes#

UnreferencedFootnotesDetector

Detect unreferenced footnotes and emit warnings.

SortFootnotes

Sort auto-numbered, labelled footnotes by the order they are referenced.

CollectFootnotes

Transform to move footnotes to the end of the document, and sort by label.

ResolveAnchorIds

Transform for resolving [name](#id) type links.

1.2.  API#

class myst_parser.mdit_to_docutils.transforms.UnreferencedFootnotesDetector(document, startnode=None)[源代码]#

Bases: docutils.transforms.Transform

Detect unreferenced footnotes and emit warnings.

Replicates sphinx-doc/sphinx#12730, but also allows for use in docutils (without sphinx).

Initialization

Initial setup for in-place document transforms.

default_priority = None#
apply(**kwargs: Any) None[源代码]#

Apply the transform.

class myst_parser.mdit_to_docutils.transforms.SortFootnotes(document, startnode=None)[源代码]#

Bases: docutils.transforms.Transform

Sort auto-numbered, labelled footnotes by the order they are referenced.

This is run before the docutils Footnote transform, where numbered labels are assigned.

Initialization

Initial setup for in-place document transforms.

default_priority = None#
apply(**kwargs: Any) None[源代码]#

Apply the transform.

class myst_parser.mdit_to_docutils.transforms.CollectFootnotes(document, startnode=None)[源代码]#

Bases: docutils.transforms.Transform

Transform to move footnotes to the end of the document, and sort by label.

Initialization

Initial setup for in-place document transforms.

default_priority = None#
apply(**kwargs: Any) None[源代码]#

Apply the transform.

class myst_parser.mdit_to_docutils.transforms.ResolveAnchorIds(document, startnode=None)[源代码]#

Bases: docutils.transforms.Transform

Transform for resolving [name](#id) type links.

Initialization

Initial setup for in-place document transforms.

default_priority = 879#
apply(**kwargs: Any) None[源代码]#

Apply the transform.