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

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mau_tex_visitor-2.0.1-py3-none-any.whl (10.9 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for mau_tex_visitor-2.0.1.tar.gz
Algorithm Hash digest
SHA256 3c440158d015f081dee46398554fc7e6c8ad073dede6c9a90c964362901bf48b
MD5 6380809199dc2a611d20a1ffdf0c622c
BLAKE2b-256 1b056fda7105a86134b665598654237494ba666ef42a53d7ff8729b2414bd1a3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mau_tex_visitor-2.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 11b3cecddc2f11b8ef5554bfbd0e6b5b8499978ba1af26803c389c463ef40bca
MD5 f7be5a5f86437c9554c1aeb61be1d954
BLAKE2b-256 c2a1fb0061410b044cccce33f696ad2becd67307114e4a96f08a603d5d4ae706

See more details on using hashes here.

Supported by

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