Qucs-S S-parameter Viewer & RF Synthesis Tools
Loading...
Searching...
No Matches
Classes | Functions | Variables
myst_parser.mdit_to_docutils.base Namespace Reference

Classes

class  DocutilsRenderer
 

Functions

nodes.document make_document (source_path="notset", parser_cls=RSTParser)
 
int token_line (SyntaxTreeNode token, int|None default=None)
 
list[nodes.meta|nodes.system_message] html_meta_to_nodes (dict[str, Any] data, nodes.document document, int line, Reporter reporter)
 
str clean_astext (nodes.Element node)
 
str default_slugify (str title)
 
str compute_unique_slug (SyntaxTreeNode token_tree, Iterable[str] slugs, None|Callable[[str], str] slug_func=None)
 

Variables

 REGEX_SCHEME = re.compile(r"^([a-zA-Z][a-zA-Z0-9+.-]*):")
 
 REGEX_URI_TEMPLATE
 
 REGEX_DIRECTIVE_START = re.compile(r"^[\s]{0,3}([`]{3,10}|[~]{3,10}|[:]{3,10})\{")
 
 _SLUGIFY_CLEAN_REGEX = re.compile(r"[^\w\u4e00-\u9fff\- ]")
 

Detailed Description

Convert Markdown-it tokens to docutils nodes.

Function Documentation

◆ clean_astext()

str myst_parser.mdit_to_docutils.base.clean_astext ( nodes.Element  node)
Like node.astext(), but ignore images.
Copied from sphinx.

◆ compute_unique_slug()

str myst_parser.mdit_to_docutils.base.compute_unique_slug ( SyntaxTreeNode  token_tree,
Iterable[str]  slugs,
None | Callable[[str], str]   slug_func = None 
)
Compute the slug for a token.

This directly mirrors the logic in `mdit_py_plugins.anchors_plugin`

◆ default_slugify()

str myst_parser.mdit_to_docutils.base.default_slugify ( str  title)
Default slugify function.

This aims to mimic the GitHub Markdown format, see:

- https://github.com/jch/html-pipeline/blob/master/lib/html/pipeline/toc_filter.rb
- https://gist.github.com/asabaylus/3071099

◆ html_meta_to_nodes()

list[nodes.meta | nodes.system_message] myst_parser.mdit_to_docutils.base.html_meta_to_nodes ( dict[str, Any]  data,
nodes.document  document,
int  line,
Reporter   reporter 
)
Replicate the `meta` directive,
by converting a dictionary to a list of pending meta nodes

See:
https://www.sphinx-doc.org/en/master/usage/restructuredtext/basics.html#html-metadata

◆ make_document()

nodes.document myst_parser.mdit_to_docutils.base.make_document (   source_path = "notset",
  parser_cls = RSTParser 
)
Create a new docutils document, with the parser classes' default settings.

◆ token_line()

int myst_parser.mdit_to_docutils.base.token_line ( SyntaxTreeNode  token,
int | None   default = None 
)
Retrieve the initial line of a token.

Variable Documentation

◆ REGEX_URI_TEMPLATE

myst_parser.mdit_to_docutils.base.REGEX_URI_TEMPLATE
Initial value:
1= re.compile(
2 r"{{\s*(uri|scheme|netloc|path|params|query|fragment)\s*}}"
3)