view.dom.core¶
Functions
|
Enter a context in which HTML nodes can be created under a fresh tree. |
|
Return a |
Classes
|
Data class representing an HTML node in the tree. |
- class HTMLNode(node_name: str, is_real: bool = True, text: str = '', attributes: ~collections.abc.MutableMapping[str, str] = <factory>, children: ~collections.abc.MutableSequence[~view.dom.core.HTMLNode] = <factory>)¶
Bases:
SupportsJavaScriptData class representing an HTML node in the tree.
- as_html_stream() Iterator[str]¶
Convert this node to actual HTML code, streaming each line individually.
- attributes: MutableMapping[str, str]¶
Dictionary containing attribute names and values as they will be rendered in the final output.
- children: MutableSequence[HTMLNode]¶
All nodes that are a direct descendant of this node.
- is_real: bool¶
Whether this node will actually be included in the output. Generally, most nodes will be rendered, but there are a few special types of nodes that are only used during the rendering process.
- classmethod new(name: str, *, child_text: str | None = None, attributes: MutableMapping[str, str] | None = None) HTMLNode¶
Create a new node that will be included in the final HTML.