ml_switcheroo.core.html.parser
==============================
.. py:module:: ml_switcheroo.core.html.parser
.. autoapi-nested-parse::
HTML Parser.
Parses the HTML DSL structure using standard library `html.parser`.
Reconstructs a Python LibCST Module representing the logic described by the visual grid.
Classes
-------
.. autoapisummary::
ml_switcheroo.core.html.parser.GridParser
ml_switcheroo.core.html.parser.HtmlParser
Module Contents
---------------
.. py:class:: GridParser
Bases: :py:obj:`html.parser.HTMLParser`
HTML Parser callback handler.
Extracts high-level model components (Name, Attributes, Operations) from the DOM stream.
.. py:attribute:: in_box
:value: False
.. py:attribute:: current_class
:value: ''
.. py:attribute:: in_header_txt
:value: False
.. py:attribute:: in_code
:value: False
.. py:attribute:: model_name
:value: 'Model'
.. py:attribute:: attrs
:type: List[Tuple[str, str, str]]
:value: []
.. py:attribute:: ops
:type: List[Tuple[str, str]]
:value: []
.. py:method:: handle_starttag(tag: str, attrs: List[Tuple[str, Optional[str]]]) -> None
.. py:method:: handle_endtag(tag: str) -> None
.. py:method:: handle_data(data: str) -> None
.. py:class:: HtmlParser(source: str)
Facade for parsing HTML strings into LibCST modules.
.. py:attribute:: source
.. py:method:: parse() -> libcst.Module