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

Uploaded Source

Built Distribution

mau_html_visitor-1.1.2-py3-none-any.whl (4.8 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for mau_html_visitor-1.1.2.tar.gz
Algorithm Hash digest
SHA256 d4d6f277dda35cc3a094757e3acb7349ec30aa00f10f621704cd8170e58441c0
MD5 c77148532ce58050042618f90d1a8d92
BLAKE2b-256 ac17e615b27121dc4b20dbe7c610a6a3d0530cc0b923a2e1acdd9ea4acbed8c4

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for mau_html_visitor-1.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 78b5203c05febaeec0d8023c4b61894d41074c4073d9610cb4e77d41b44ad79d
MD5 123619c56616cbd16727a84766f1b82a
BLAKE2b-256 7cc6e55e88e3b38fbd72d5728e15aafad9c57ea1431945f1c0cb213d48847bdf

See more details on using hashes here.

Provenance

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