Mau - A template-based markup language
Mau elements and nodes
Zane noted how artistically the elements of both carpet and machine had been integrated to make the device unidentifiable; this was a symbolic example, not a literal one. It had also been hastily done, for Luna had been home only a few hours.
Piers Anthony, On a Pale Horse (1983)
This chapter contains the full documentation of each Mau node, which is the Python dictionary created for each Mau syntax element. For each node I will provide the name of the template (without the format extension), it's fields, and a brief description of each of them.
To simplify the use of this chapter I will list the templates in alphabetical order.
Some notes on fields and types.
- The most commong type for node fields is
string
that represents pure text. - The type
target
means that the content is in the target format. For example when rendering in HTML a field like"content": target
means that using{{ content }}
in the Jinja template will insert some HTML. - The type
boolean
is a Python boolean that can be used directly in Jinjaif
statements. - The type
list
means a list of strings. The typelist[TYPE]
means a list of values of the givenTYPE
. - The type
dict
means a dictionary whose keys and values are strings. Since block definitions can fix which fields are allowed, a syntax likedict[key1, key2]
means a dictionary with keys"key1"
and"key2"
. - A value like
a | b | c
means that the value can only be one of the listed ones. - Each node receives the field
type
that is used to select the template.
Block¶
This node represents a standard block. The fields blocktype
and engine
are used to find specific templates, see the dedicated chapter for details.
Template name: block.html
"type": string
"blocktype": string
"content": target
"secondary_content": target
"classes": list
"engine": raw | source | mau | deafult
"preprocessor": none
"args": list
"kwargs": dict
"title": string
<div class="{{ blocktype }}{% if classes %} {{ classes }}{% endif %}">
{% if title %}
<div class="title">{{ title }}</div>
{% endif %}
<div class="content">{{ content }}</div>
</div>
Block admonition¶
Template name: block-admonition
"type": string
"blocktype": string
"content": target
"secondary_content": target
"classes": list
"engine": raw | source | mau | deafult
"preprocessor": none
"args": list
"kwargs": dict[class, icon, label]
"title": string
<div class="admonition {{ kwargs.class }}">
<i class="{{ kwargs.icon }}"></i>
<div class="content">
<div class="title">{{ kwargs.label }}</div>
<div>{{ content }}</div>
</div>
</div>
Block quote¶
Template name: block-quote
"type": string
"blocktype": string
"content": target
"secondary_content": target
"classes": list
"engine": raw | source | mau | deafult
"preprocessor": none
"args": list
"kwargs": dict
"title": string
<blockquote>
{{ content }}
<cite>
{% if kwargs.attribution %}
{{ kwargs.attribution }}
{% else %}
{{ secondary_content }}
{% endif %}
</cite>
</blockquote>
Block source¶
Template name: block-source
"type": string
"blocktype": string
"content": target
"secondary_content": target
"classes": list
"engine": raw | source | mau | deafult
"preprocessor": none
"args": list
"kwargs": dict[callouts]
"title": string
<div{% if blocktype %} class="{{ blocktype }}"{% endif %}>
{% if title %}
<div class="title">{{ title }}</div>
{% endif %}
<div class="content">{{ content }}</div>
{% if kwargs.callouts %}
<div class="callouts">
<table>
<tbody>
{% for callout in kwargs.callouts %}
<tr>
<td>{{ callout[0] }}</td>
<td>{{ callout[1] }}</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
{% endif %}
</div>
Callout¶
This is the template used to inject a callout in the source code.
Template name: callout
"name": string
<span class="callout">{{ name }}</span>
Class¶
Template name: class
"type": string
"classes": list
"content": target
<span class="{{ classes }}">{{ content }}</span>
Footnote definition¶
Template name: footnote_def
"type": string
"refanchor": string
"defanchor": string
"number": string
"content": target
<div id="{{ defanchor }}">
<a href="#{{ refanchor }}">{{ number }}</a> {{ content }}
</div>
Footnote reference¶
Template name: footnote_ref
"type": string
"refanchor": string
"defanchor": string
"number": string
"content": target
<sup>
[<a id="{{ refanchor }}" href="#{{ defanchor }}">{{ number }}</a>]
</sup>
Footnotes¶
Template name: footnotes
"type": string
"entries": list[target]
<div id="_footnotes">{{ entries }}</div>
Header¶
Template name: header
"type": string
"value": string
"level": string
"anchor": string
"tags": list
"kwargs": dict
<h{{ level }} id="{{ anchor }}">{{ value }}</h{{ level }}>
Horizontal rule¶
Template name: horizontal_rule
"type": string
<hr>
Image¶
Template name: image
"type": string
"uri": string
"alt_text": string
"width": string
"height": string
<div class="imageblock">
<div class="content">
<img src="{{ uri }}"{% if alt_text %} alt="{{ alt_text }}"{% endif %} />
{% if title %}
<div class="title">{{ title }}</div>
{% endif %}
</div>
</div>
Inline image¶
Template name: inline_image
"type": string
"uri": string
"alt_text": string
"width": string
"height": string
<span class="image">
<img src="{{ uri }}"{%if alt_text %} alt="{{ alt_text }}"{% endif %}>
</span>
Link¶
Template name: link
"type": string
"target": string
"text": string
<a href="{{ target }}">{{ text }}</a>
List¶
Template name: list
"type": string
"ordered": boolean
"items": list
"main_node": boolean
<{% if ordered %}ol{% else %}ul{% endif %}>
{{ items }}
</{% if ordered %}ol{% else %}ul{% endif %}>
List item¶
Template name: list_item
"type": string
"level": string
"content": target
<li>{{ content }}</li>
Paragraph¶
Template name: paragraph
"type": string
"content": target
"args": list
"kwargs": dict
<p>{{ content }}</p>
Star¶
Template name: star
"type": string
"value": string
"content": target
<strong>{{ content }}</strong>
TOC¶
Template name: toc
"type": string
"entries": list[target]
<div>{% if entries%}<ul>{{ entries }}</ul>{% endif %}</div>
TOC entry¶
Template name: toc_entry
"type": string
"header": target
"children": list[target]
<li>
<a href="#{{ header.anchor }}">{{ header.value }}</a>
{% if children %}
<ul>{{ children }}</ul>
{% endif %}
</li>
Underscore¶
Template name: underscore
"type": string
"value": string
"content": target
<em>{{ content }}</em>
Verbatim¶
Template name: verbatim
"type": string
"value": string
"content": target
<code>{{ content }}</code>