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

Uploaded Source

Built Distribution

mau_tex_visitor-1.1.1-py3-none-any.whl (4.1 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for mau_tex_visitor-1.1.1.tar.gz
Algorithm Hash digest
SHA256 013d0a400262e3a4cd69ee7bc1117857446a6a4376f61a76b1bf5f32700b7233
MD5 f516c366ec1753e43f98fdfa99c89288
BLAKE2b-256 8a91611a691ae2bc346409ddca19b42224cc56930dc34cdb481c717e940f9df7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mau_tex_visitor-1.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 1a6a2d1fd24d76849f2d9e9e96efb12c8846c494926505dce062a40ff0ddb529
MD5 05518c9808891121bb04497217101bb9
BLAKE2b-256 52d6e15ec5c495a86d42bd52f41ae76eaf575fe01cf4a9283d436bf269f503af

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