![]() |
Qucs-S S-parameter Viewer & RF Synthesis Tools
|
Public Member Functions | |
| None | __init__ (self, Sequence[Token] tokens=(), *bool create_root=True) |
| str | __repr__ (self) |
| _NodeType | __getitem__ (_NodeType self, int item) |
| list[_NodeType] | __getitem__ (_NodeType self, slice item) |
| _NodeType|list[_NodeType] | __getitem__ (_NodeType self, int|slice item) |
| list[Token] | to_tokens (_NodeType self) |
| list[_NodeType] | children (_NodeType self) |
| None | children (_NodeType self, list[_NodeType] value) |
| _NodeType|None | parent (_NodeType self) |
| None | parent (_NodeType self, _NodeType|None value) |
| bool | is_root (self) |
| bool | is_nested (self) |
| Sequence[_NodeType] | siblings (_NodeType self) |
| str | type (self) |
| _NodeType|None | next_sibling (_NodeType self) |
| _NodeType|None | previous_sibling (_NodeType self) |
| str | pretty (self, *int indent=2, bool show_text=False, int _current=0) |
| Generator[_NodeType, None, None] | walk (_NodeType self, *bool include_self=True) |
| str | tag (self) |
| dict[str, str|int|float] | attrs (self) |
| None|str|int|float | attrGet (self, str name) |
| tuple[int, int]|None | map (self) |
| int | level (self) |
| str | content (self) |
| str | markup (self) |
| str | info (self) |
| dict[Any, Any] | meta (self) |
| bool | block (self) |
| bool | hidden (self) |
Public Attributes | |
| token | |
| nester_tokens | |
| siblings | |
Protected Member Functions | |
| None | _add_child (self, Sequence[Token] tokens) |
| None | _set_children_from_tokens (self, Sequence[Token] tokens) |
| Token | _attribute_token (self) |
Protected Attributes | |
| _children | |
| _parent | |
A Markdown syntax tree node.
A class that can be used to construct a tree representation of a linear
`markdown-it-py` token stream.
Each node in the tree represents either:
- root of the Markdown document
- a single unnested `Token`
- a `Token` "_open" and "_close" token pair, and the tokens nested in
between
| None markdown_it.tree.SyntaxTreeNode.__init__ | ( | self, | |
| Sequence[Token] | tokens = (), |
||
| *bool | create_root = True |
||
| ) |
Initialize a `SyntaxTreeNode` from a token stream. If `create_root` is True, create a root node for the document.
|
protected |
Make a child node for `self`.
|
protected |
Return the `Token` that is used as the data source for the properties defined below.
|
protected |
Convert the token stream to a tree structure and set the resulting nodes as children of `self`.
| None | str | int | float markdown_it.tree.SyntaxTreeNode.attrGet | ( | self, | |
| str | name | ||
| ) |
Get the value of attribute `name`, or null if it does not exist.
| dict[str, str | int | float] markdown_it.tree.SyntaxTreeNode.attrs | ( | self | ) |
Html attributes.
| bool markdown_it.tree.SyntaxTreeNode.block | ( | self | ) |
True for block-level tokens, false for inline tokens.
| str markdown_it.tree.SyntaxTreeNode.content | ( | self | ) |
In a case of self-closing tag (code, html, fence, etc.), it has contents of this tag.
| bool markdown_it.tree.SyntaxTreeNode.hidden | ( | self | ) |
If it's true, ignore this element when rendering. Used for tight lists to hide paragraphs.
| str markdown_it.tree.SyntaxTreeNode.info | ( | self | ) |
fence infostring
| bool markdown_it.tree.SyntaxTreeNode.is_nested | ( | self | ) |
Is this node nested?. Returns `True` if the node represents a `Token` pair and tokens in the sequence between them, where `Token.nesting` of the first `Token` in the pair is 1 and nesting of the other `Token` is -1.
| bool markdown_it.tree.SyntaxTreeNode.is_root | ( | self | ) |
Is the node a special root node?
| int markdown_it.tree.SyntaxTreeNode.level | ( | self | ) |
nesting level, the same as `state.level`
| tuple[int, int] | None markdown_it.tree.SyntaxTreeNode.map | ( | self | ) |
Source map info. Format: `tuple[ line_begin, line_end ]`
| str markdown_it.tree.SyntaxTreeNode.markup | ( | self | ) |
'*' or '_' for emphasis, fence string for fence, etc.
| dict[Any, Any] markdown_it.tree.SyntaxTreeNode.meta | ( | self | ) |
A place for plugins to store an arbitrary data.
| _NodeType | None markdown_it.tree.SyntaxTreeNode.next_sibling | ( | _NodeType | self | ) |
Get the next node in the sequence of siblings. Returns `None` if this is the last sibling.
| str markdown_it.tree.SyntaxTreeNode.pretty | ( | self, | |
| *int | indent = 2, |
||
| bool | show_text = False, |
||
| int | _current = 0 |
||
| ) |
Create an XML style string of the tree.
| _NodeType | None markdown_it.tree.SyntaxTreeNode.previous_sibling | ( | _NodeType | self | ) |
Get the previous node in the sequence of siblings. Returns `None` if this is the first sibling.
| Sequence[_NodeType] markdown_it.tree.SyntaxTreeNode.siblings | ( | _NodeType | self | ) |
Get siblings of the node. Gets the whole group of siblings, including self.
| str markdown_it.tree.SyntaxTreeNode.tag | ( | self | ) |
html tag name, e.g. \"p\"
| list[Token] markdown_it.tree.SyntaxTreeNode.to_tokens | ( | _NodeType | self | ) |
Recover the linear token stream.
| str markdown_it.tree.SyntaxTreeNode.type | ( | self | ) |
Get a string type of the represented syntax.
- "root" for root nodes
- `Token.type` if the node represents an unnested token
- `Token.type` of the opening token, with "_open" suffix stripped, if
the node represents a nester token pair
| Generator[_NodeType, None, None] markdown_it.tree.SyntaxTreeNode.walk | ( | _NodeType | self, |
| *bool | include_self = True |
||
| ) |
Recursively yield all descendant nodes in the tree starting at self. The order mimics the order of the underlying linear token stream (i.e. depth first).