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

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for mau_tex_visitor-1.0.0.tar.gz
Algorithm Hash digest
SHA256 2ea3ae20186a9b67bf1494a60f82b8f418c13398584dd09086306bdf9dc7d063
MD5 8a0f8465c282cb2b045a15febee0fe99
BLAKE2b-256 53d25ab1deece37088d5889603f5d2f3cc11022a5b9510603ca002212b5810ef

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mau_tex_visitor-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8c87bf69d4f941ba2cc7affc0589e071f1000cae346b4a708a6e58954b6d96ac
MD5 8d34a22e50bed7297b71c12cdb09916e
BLAKE2b-256 ee560d04ceda85fd74e32fea0d34e6489d633e448439465469dfbbfd919dfeb8

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