A visitor for Mau that converts the AST into HTML
Project description
Mau HTML Visitor
This is a plugin for the Mau markup language. The plugin provides the conversion from Mau source to HTML.
You can install this plugin with
pip install mau-html-visitor
and Mau will automatically be able to load it. To use the visitor you need to load it and to pass it to the class Mau
when you instantiate it
from mau import Mau, load_visitors
visitor_classes = load_visitors()
visitors = {i.format_code: i for i in visitor_classes}
visitor_class = visitors["html"]
mau = Mau(
"path/of/the/source",
visitor_class=visitor_class,
)
lexer = self._mau.run_lexer(text)
parser = self._mau.run_parser(lexer.tokens)
content = self._mau.process(parser.nodes, parser.environment)
if visitor_class.transform:
content = visitor_class.transform(content)
The default extension for templates is .html
. The plugin uses Pygments to provide source code highlighting.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file mau_html_visitor-1.1.1.tar.gz
.
File metadata
- Download URL: mau_html_visitor-1.1.1.tar.gz
- Upload date:
- Size: 4.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: python-requests/2.28.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3427642da04e745aa5f363ea2d4b827e6472cbeea94f1da2117e33c5e20eee78 |
|
MD5 | 09328f331144edb81c7aa811dcd61fc7 |
|
BLAKE2b-256 | 8f68eebe90cbd7a0ec8bcb1341ed61f65320782655ece7e184d8389a7380d2d3 |
Provenance
File details
Details for the file mau_html_visitor-1.1.1-py3-none-any.whl
.
File metadata
- Download URL: mau_html_visitor-1.1.1-py3-none-any.whl
- Upload date:
- Size: 4.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: python-requests/2.28.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4ca9de0ed90d6f3d9810af6e2377975b6f03a40aeef8ea376618daadb12c7851 |
|
MD5 | 71b10c600b761f54903e7dafbdfbc89b |
|
BLAKE2b-256 | 4e5b4da7b62329b3e743896e0cac4aa4a64eef80302787597ed4ccf7878238ee |