Skip to main content

A lightweight markup language

Project description

Mau

Mau is a lightweight markup language heavily inspired by AsciiDoc, Asciidoctor and Markdown.

As I wasn't satisfied by the results I got with those tools I decided to try to write my own language and the tool to render it.

I am currently using Mau to render posts on my blog The Digital Cat and the online version of my book "Clean Architectures in Python". I also used it to transpile the code of the book to Markua, to be able to publish the book on Leanpub using their toolchain.

Quick start

To install Mau use pip

pip install mau

To convert Mau sources into HTML just run

mau -i source.mau -o destination.html -f html

To use Mau in your tool you can run it programmatically

from mau import Mau

mau = Mau(target_format="html")

mau.process(text)

Check out Mau documentation for further information.

Pelican plugin

There is a Pelican plugin that enables you to use Mau in your blog. Check it at https://github.com/pelican-plugins/mau-reader.

You can see the plugin in action at https://www.thedigitalcatonline.com/blog/2021/02/22/mau-a-lightweight-markup-language/ and on other pages in my blog.

Incompatibility between Mau 2.x and Mau 1.x

Changes to they Mau syntax:

  • The macro [footnote]() requires now a strict attributes syntax, so you need to put between quotes any text that contains commas. In Mau 1.x footnotes use the text between round brackets directly, so there was no need for quotes. The old behaviour can be still turned on setting the configuration value v1_backward_compatibility to True. The old syntax is however considered deprecated, so my advice is to change the source as soon as possible. Example [footnote](A footnote, with a comma) should become [footnote]("A footnote, with a comma").
  • Raw blocks have been removed, you should use the attribute engine=raw instead. See the documentation for details about engines.
  • Conditional blocks have been removed, you should use the attribute condition="if:VARIABLE:VALUE". See the documentation for details about conditions.
  • Quote blocks now accept the attribution as secondary content, which accepts Mau syntax. The attribute attribution is still supported but has been deprecated.

Changes to templates:

  • Block template now correctly provides blocktype instead of type.
  • Admonition block template name changed from admonition to block-admonition. Attributes class, icon, and label are now respectively kwargs.class, kwargs.icon, and kwargs.label.
  • Source block template name changed from source to block-source. The default CSS class in HTML is source instead of code. The content is provided by the key content instead of code.
  • Quote block template name changed from quote to block-quote. The attribute attribution has been renamed kwargs.attribution and is still supported but deprecated. The attribution is now provided by secondary_content. The Mau syntax for quote blocks also changed accordingly. You can now specify the attribution in the secondary content and use Mau syntax to format it.
  • Footnote definition template now provides the content as content instead of text.
  • TOC entry template receives header objects, so anchor becomes header.anchor and text becomes header.value.

Support

You may report bugs or missing features use the issues page. If you want to ask for help or discuss ideas use the discussions page

This project has been set up using PyScaffold 3.3.1. For details and usage information on PyScaffold see https://pyscaffold.org/.

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

Uploaded Source

Built Distribution

mau-2.0.0-py2.py3-none-any.whl (40.8 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file mau-2.0.0.tar.gz.

File metadata

  • Download URL: mau-2.0.0.tar.gz
  • Upload date:
  • Size: 66.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.56.2 CPython/3.8.10

File hashes

Hashes for mau-2.0.0.tar.gz
Algorithm Hash digest
SHA256 a53f33195cece644cca43cb08a540001d72c5a23c4438953196f3efcb5701ba2
MD5 5f12681a0d70f32cc085695b0ceb98eb
BLAKE2b-256 1159fa8aa9d8467d86272866b5c620d68531b7e6da337c8a4daf64aa0656fde0

See more details on using hashes here.

File details

Details for the file mau-2.0.0-py2.py3-none-any.whl.

File metadata

  • Download URL: mau-2.0.0-py2.py3-none-any.whl
  • Upload date:
  • Size: 40.8 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.56.2 CPython/3.8.10

File hashes

Hashes for mau-2.0.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 c595da3e8ab34df12adfc16e3aaa2c7d855fb7a3d419d65f955168e72bce91c7
MD5 23d1f4b29a39923acc2e2aeb620d4bf1
BLAKE2b-256 49fdcc4c121c56bb5ffe15eea0dd1e140816953f9bfaf108a6b2920fa6294277

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