A visitor for Mau that converts the AST into TeX
Project description
Mau TeX Visitor
This is a plugin for the Mau markup language. The plugin provides the conversion from Mau source to TeX.
You can install this plugin with
pip install mau-tex-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["tex"]
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 .tex
.
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
mau_tex_visitor-2.0.0.tar.gz
(6.9 kB
view details)
Built Distribution
File details
Details for the file mau_tex_visitor-2.0.0.tar.gz
.
File metadata
- Download URL: mau_tex_visitor-2.0.0.tar.gz
- Upload date:
- Size: 6.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: python-requests/2.31.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 323379af2300e4b642821fbbc53db72f7856767c55197828c35e06f94eec1a39 |
|
MD5 | d303a1f4833d8fb0a9c241da335991f0 |
|
BLAKE2b-256 | 068265018f3e7fe164d1c39f57de9fe05d96d01742831a9e62b2a5d99e072605 |
File details
Details for the file mau_tex_visitor-2.0.0-py3-none-any.whl
.
File metadata
- Download URL: mau_tex_visitor-2.0.0-py3-none-any.whl
- Upload date:
- Size: 10.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: python-requests/2.31.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 05a5c4742833f78056c065a67d54d9738d90d3049e72a89104684b8771e1d0b9 |
|
MD5 | ee436620390e0dfe57e80dff1677baaf |
|
BLAKE2b-256 | 6fe2a8f3bcae7361e592e1a82aa10799a47f63ac7da49495b144022af7e0f7a0 |