Skip to main content

A visitor for Mau that converts the AST into HTML

Project description

Mau HTML Visitor

This is a plugin for the Mau markup language. The plugin provides the conversion from Mau source to HTML.

You can install this plugin with

pip install mau-html-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["html"]

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 .html. The plugin uses Pygments to provide source code highlighting.

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

Uploaded Source

Built Distribution

mau_html_visitor-2.0.1-py3-none-any.whl (12.4 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for mau_html_visitor-2.0.1.tar.gz
Algorithm Hash digest
SHA256 3c2c8aa64c4d472c62b35b84afeecea38ec3a819d0e97748dfd926d687dab8d8
MD5 12f161bef0d8a3aceafd8ca327bee296
BLAKE2b-256 12396ffbdf7ed551c47fd4c21ad3814e484facbf1f99870fcf472d739cb4ec9c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mau_html_visitor-2.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 57d2d96581a75c0902f613e44cbebc3bd814e87d9a1c714215d313424cb38f19
MD5 4bfe39dba4006d2c053f1eaa87ee1848
BLAKE2b-256 57f3cb6456b12f2ecb68b25ce40aef08ad42c1c9fd8bf14ede2c7dc705d0cc60

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