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({}, "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 valuev1_backward_compatibility
toTrue
. 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 oftype
. - Admonition block template name changed from
admonition
toblock-admonition
. Attributesclass
,icon
, andlabel
are now respectivelykwargs.class
,kwargs.icon
, andkwargs.label
. - Source block template name changed from
source
toblock-source
. The default CSS class in HTML issource
instead ofcode
. The content is provided by the keycontent
instead ofcode
. - Quote block template name changed from
quote
toblock-quote
. The attributeattribution
has been renamedkwargs.attribution
and is still supported but deprecated. The attribution is now provided bysecondary_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 oftext
. - TOC entry template receives header objects, so
anchor
becomesheader.anchor
andtext
becomesheader.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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file mau-2.0.3.tar.gz
.
File metadata
- Download URL: mau-2.0.3.tar.gz
- Upload date:
- Size: 68.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.10.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | bb2e9d8442bc95b7e6b8e9e03b198053c53ec961f52be93597711bdb20d2e62d |
|
MD5 | 96710ce92ec797419f6f64e23421fb20 |
|
BLAKE2b-256 | 8092f326884b5035fa5a61a5bd19c4496b6c52d46448a91161a0a7122f50ac37 |
File details
Details for the file mau-2.0.3-py2.py3-none-any.whl
.
File metadata
- Download URL: mau-2.0.3-py2.py3-none-any.whl
- Upload date:
- Size: 41.1 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.10.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2f2b7a33970427e925fd1630b3efeef61f87e24b41db941279efae59c11abe7e |
|
MD5 | 06be161040c59822cfeacc2a4f7d116c |
|
BLAKE2b-256 | 6b54708ed319ff349c34d7370c0edb584dfe6b52ad7b648353878ae68bf92481 |