|
|
None | __post_init__ (self) |
| |
|
int | attrIndex (self, str name) |
| |
| list[tuple[str, str|int|float]] | attrItems (self) |
| |
| None | attrPush (self, tuple[str, str|int|float] attrData) |
| |
| None | attrSet (self, str name, str|int|float value) |
| |
| None|str|int|float | attrGet (self, str name) |
| |
| None | attrJoin (self, str name, str value) |
| |
| Token | copy (self, **Any changes) |
| |
| MutableMapping[str, Any] | as_dict (self, *bool children=True, bool as_upstream=True, Callable[[dict[Any, Any]], Any]|None meta_serializer=None, Callable[[str, Any], bool]|None filter=None, Callable[..., MutableMapping[str, Any]] dict_factory=dict) |
| |
| Token | from_dict (cls, MutableMapping[str, Any] dct) |
| |
|
|
str | type |
| |
|
str | tag |
| |
|
Literal | nesting [-1, 0, 1] |
| |
|
dict | attrs = dc.field(default_factory=dict) |
| |
|
list | map = None |
| |
|
int | level = 0 |
| |
|
list | children = None |
| |
|
str | content = "" |
| |
|
str | markup = "" |
| |
|
str | info = "" |
| |
|
dict | meta = dc.field(default_factory=dict) |
| |
|
bool | block = False |
| |
|
bool | hidden = False |
| |
◆ as_dict()
| MutableMapping[str, Any] markdown_it.token.Token.as_dict |
( |
|
self, |
|
|
*bool |
children = True, |
|
|
bool |
as_upstream = True, |
|
|
Callable[[dict[Any, Any]], Any] | None |
meta_serializer = None, |
|
|
Callable[[str, Any], bool] | None |
filter = None, |
|
|
Callable[..., MutableMapping[str, Any]] |
dict_factory = dict |
|
) |
| |
Return the token as a dictionary.
:param children: Also convert children to dicts
:param as_upstream: Ensure the output dictionary is equal to that created by markdown-it
For example, attrs are converted to null or lists
:param meta_serializer: hook for serializing ``Token.meta``
:param filter: A callable whose return code determines whether an
attribute or element is included (``True``) or dropped (``False``).
Is called with the (key, value) pair.
:param dict_factory: A callable to produce dictionaries from.
For example, to produce ordered dictionaries instead of normal Python
dictionaries, pass in ``collections.OrderedDict``.
◆ attrGet()
| None | str | int | float markdown_it.token.Token.attrGet |
( |
|
self, |
|
|
str |
name |
|
) |
| |
Get the value of attribute `name`, or null if it does not exist.
◆ attrItems()
| list[tuple[str, str | int | float]] markdown_it.token.Token.attrItems |
( |
|
self | ) |
|
Get (key, value) list of attrs.
◆ attrJoin()
| None markdown_it.token.Token.attrJoin |
( |
|
self, |
|
|
str |
name, |
|
|
str |
value |
|
) |
| |
Join value to existing attribute via space.
Or create new attribute if not exists.
Useful to operate with token classes.
◆ attrPush()
| None markdown_it.token.Token.attrPush |
( |
|
self, |
|
|
tuple[str, str | int | float] |
attrData |
|
) |
| |
Add `[ name, value ]` attribute to list. Init attrs if necessary.
◆ attrSet()
| None markdown_it.token.Token.attrSet |
( |
|
self, |
|
|
str |
name, |
|
|
str | int | float |
value |
|
) |
| |
Set `name` attribute to `value`. Override old value if exists.
◆ copy()
| Token markdown_it.token.Token.copy |
( |
|
self, |
|
|
**Any |
changes |
|
) |
| |
Return a shallow copy of the instance.
◆ from_dict()
| Token markdown_it.token.Token.from_dict |
( |
|
cls, |
|
|
MutableMapping[str, Any] |
dct |
|
) |
| |
Convert a dict to a Token.
The documentation for this class was generated from the following file:
- docs/help/help-venv/lib/python3.12/site-packages/markdown_it/token.py