<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom"><title>The Digital Cat - Mau</title><link href="https://www.thedigitalcatonline.com/" rel="alternate"></link><link href="https://www.thedigitalcatonline.com/categories/mau/atom.xml" rel="self"></link><id>https://www.thedigitalcatonline.com/</id><updated>2021-02-25T18:00:00+00:00</updated><subtitle>Adventures of a curious cat in the land of programming</subtitle><entry><title>Mau: a lightweight markup language</title><link href="https://www.thedigitalcatonline.com/blog/2021/02/22/mau-a-lightweight-markup-language/" rel="alternate"></link><published>2021-02-22T10:00:00+00:00</published><updated>2021-02-25T18:00:00+00:00</updated><author><name>Leonardo Giordani</name></author><id>tag:www.thedigitalcatonline.com,2021-02-22:/blog/2021/02/22/mau-a-lightweight-markup-language/</id><summary type="html">&lt;p&gt;Mau is a lightweight markup language heavily inspired by AsciiDoc that makes is very easy to write blog posts or books.&lt;/p&gt;</summary><content type="html">&lt;h2 id="what-is-mau-fb3c"&gt;What is Mau?&lt;a class="headerlink" href="#what-is-mau-fb3c" title="Permanent link"&gt;¶&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Mau is a lightweight markup language heavily inspired by AsciiDoc that makes is very easy to write blog posts or books.&lt;/p&gt;&lt;p&gt;The main goal of Mau is to provide a customisable markup language, reusing the good parts of AsciiDoc and providing a pure Python 3 implementation.&lt;/p&gt;&lt;p&gt;You can find Mau&amp;#x27;s source code on &lt;a href="https://github.com/Project-Mau/mau"&gt;GitHub&lt;/a&gt;.&lt;/p&gt;&lt;h2 id="why-not-markdown-or-asciidoc-b535"&gt;Why not Markdown or AsciiDoc?&lt;a class="headerlink" href="#why-not-markdown-or-asciidoc-b535" title="Permanent link"&gt;¶&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Markdown is a very good format, and I used it for all the posts in this blog so far. I grew increasingly unsatisfied, though, because of the lack of some features and the poor amount of customisation that it provides. When I wrote the second version of my book &amp;quot;Clean Architectures in Python&amp;quot; I considered using Markdown (through Pelican), but I couldn&amp;#x27;t find a good way to create tips and warnings. Recently, Python Markdown added a feature that allows to specify the file name for the source code, but the resulting HTML cannot easily be changed, making it difficult to achieve the graphical output I wanted.&lt;/p&gt;&lt;p&gt;AsciiDoc started as a Python project, but then was abandoned and eventually resurrected by Dan Allen with Asciidoctor. AsciiDoc has a lot of features and I consider it superior to Markdown, but Asciidoctor is a Ruby program, and this made it difficult for me to use it. In addition, the standard output of Asciidoctor is a nice single HTML page but again customising it is a pain. I had to struggle to add my Google Analytics code and a &lt;code&gt;sitemap.xml&lt;/code&gt; to the book site.&lt;/p&gt;&lt;p&gt;I simply thought I could try to write my own tool, in a language that I know well (Python). It works, and I learned a lot writing it, so I&amp;#x27;m definitely happy. I&amp;#x27;d be delighted to know that this can be useful to other people, though.&lt;/p&gt;&lt;h2 id="pelican-f581"&gt;Pelican&lt;a class="headerlink" href="#pelican-f581" title="Permanent link"&gt;¶&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;A reader for Mau source files is available in Pelican, you can find the code at &lt;a href="https://github.com/getpelican/pelican-plugins/pull/1327"&gt;https://github.com/getpelican/pelican-plugins/pull/1327&lt;/a&gt;. Simply add the code to your Pelican plugins directory and activate it adding &lt;code&gt;&amp;#34;mau_reader&amp;#34;&lt;/code&gt; to &lt;code&gt;PLUGINS&lt;/code&gt; in your file &lt;code&gt;pelicanconf.py&lt;/code&gt;. The Mau reader processes only files with the &lt;code&gt;.mau&lt;/code&gt; extension, so you can use Markdown/reStructuredText and Mau at the same time.&lt;/p&gt;&lt;h2 id="development-f3c5"&gt;Development&lt;a class="headerlink" href="#development-f3c5" title="Permanent link"&gt;¶&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;If you are interested you can leave a star on the project on the &lt;a href="https://github.com/Project-Mau/mau"&gt;GitHub page&lt;/a&gt;, start using it, or contribute ideas, code, bugfixes.&lt;/p&gt;&lt;h2 id="feedback-d845"&gt;Feedback&lt;a class="headerlink" href="#feedback-d845" title="Permanent link"&gt;¶&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Feel free to reach me on &lt;a href="https://twitter.com/thedigicat"&gt;Twitter&lt;/a&gt; if you have questions. The &lt;a href="https://github.com/TheDigitalCatOnline/blog_source/issues"&gt;GitHub issues&lt;/a&gt; page is the best place to submit corrections.&lt;/p&gt;</content><category term="Programming"></category><category term="Python"></category><category term="Python2"></category><category term="Python3"></category><category term="Mau"></category></entry></feed>