Skip to main content

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-1.1.0.tar.gz (4.0 kB view details)

Uploaded Source

Built Distribution

mau_tex_visitor-1.1.0-py3-none-any.whl (4.0 kB view details)

Uploaded Python 3

File details

Details for the file mau_tex_visitor-1.1.0.tar.gz.

File metadata

  • Download URL: mau_tex_visitor-1.1.0.tar.gz
  • Upload date:
  • Size: 4.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.28.1

File hashes

Hashes for mau_tex_visitor-1.1.0.tar.gz
Algorithm Hash digest
SHA256 f0dc1defb833739bc4352d27a557c299fce8b6c4bf629074d878266917195520
MD5 f21ec9726b0c35616a85526f885efd65
BLAKE2b-256 5cc0a5b9bd02ca248454d45c4bdecbc3de9dafd929797a89bb381f4238e3479a

See more details on using hashes here.

File details

Details for the file mau_tex_visitor-1.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for mau_tex_visitor-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d7834a4cd0c08a029180b2c1033db5d5131c53a59d4350088e89522f662c3648
MD5 d409b005ecda0ea20ee102e8cf81bce6
BLAKE2b-256 d1314203a7e5acdbe246e843a1ebd96425293c91aa97abc39742c18e58cd84c8

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page