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 Jinja if statements.
  • The type list means a list of strings. The type list[TYPE] means a list of values of the given TYPE.
  • The type dict means a dictionary whose keys and values are strings. Since block definitions can fix which fields are allowed, a syntax like dict[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

Fields
"type": string
"blocktype": string
"content": target
"secondary_content": target
"classes": list
"engine": raw | source | mau | deafult
"preprocessor": none
"args": list
"kwargs": dict
"title": string
Default HTML template
<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

Fields
"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
Default HTML template
<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

Fields
"type": string
"blocktype": string
"content": target
"secondary_content": target
"classes": list
"engine": raw | source | mau | deafult
"preprocessor": none
"args": list
"kwargs": dict
"title": string
Default HTML template
<blockquote>
  {{ content }}

  <cite>
    {% if kwargs.attribution %}
    {{ kwargs.attribution }}
    {% else %}
    {{ secondary_content }}
    {% endif %}
  </cite>
</blockquote>

Block source

Template name: block-source

Fields
"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
Default HTML template
<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

Fields
"name": string
Default HTML template
<span class="callout">{{ name }}</span>

Class

Template name: class

Fields
"type": string
"classes": list
"content": target
Default HTML template
<span class="{{ classes }}">{{ content }}</span>

Footnote definition

Template name: footnote_def

Fields
"type": string
"refanchor": string
"defanchor": string
"number": string
"content": target
Default HTML template
<div id="{{ defanchor }}">
  <a href="#{{ refanchor }}">{{ number }}</a> {{ content }}
</div>

Footnote reference

Template name: footnote_ref

Fields
"type": string
"refanchor": string
"defanchor": string
"number": string
"content": target
Default HTML template
<sup>
  [<a id="{{ refanchor }}" href="#{{ defanchor }}">{{ number }}</a>]
</sup>

Footnotes

Template name: footnotes

Fields
"type": string
"entries": list[target]
Default HTML template
<div id="_footnotes">{{ entries }}</div>

Template name: header

Fields
"type": string
"value": string
"level": string
"anchor": string
"tags": list
"kwargs": dict
Default HTML template
<h{{ level }} id="{{ anchor }}">{{ value }}</h{{ level }}>

Horizontal rule

Template name: horizontal_rule

Fields
"type": string
Default HTML template
<hr>

Image

Template name: image

Fields
"type": string
"uri": string
"alt_text": string
"width": string
"height": string
Default HTML template
<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

Fields
"type": string
"uri": string
"alt_text": string
"width": string
"height": string
Default HTML template
<span class="image">
  <img src="{{ uri }}"{%if alt_text %} alt="{{ alt_text }}"{% endif %}>
</span>

Template name: link

Fields
"type": string
"target": string
"text": string
Default HTML template
<a href="{{ target }}">{{ text }}</a>

List

Template name: list

Fields
"type": string
"ordered": boolean
"items": list
"main_node": boolean
Default HTML template
<{% if ordered %}ol{% else %}ul{% endif %}>
  {{ items }}
</{% if ordered %}ol{% else %}ul{% endif %}>

List item

Template name: list_item

Fields
"type": string
"level": string
"content": target
Default HTML template
<li>{{ content }}</li>

Paragraph

Template name: paragraph

Fields
"type": string
"content": target
"args": list
"kwargs": dict
Default HTML template
<p>{{ content }}</p>

Star

Template name: star

Fields
"type": string
"value": string
"content": target
Default HTML template
<strong>{{ content }}</strong>

TOC

Template name: toc

Fields
"type": string
"entries": list[target]
Default HTML template
<div>{% if entries%}<ul>{{ entries }}</ul>{% endif %}</div>

TOC entry

Template name: toc_entry

Fields
"type": string
"header": target
"children": list[target]
Default HTML template
<li>
  <a href="#{{ header.anchor }}">{{ header.value }}</a>

  {% if children %}
  <ul>{{ children }}</ul>
  {% endif %}
</li>

Underscore

Template name: underscore

Fields
"type": string
"value": string
"content": target
Default HTML template
<em>{{ content }}</em>

Verbatim

Template name: verbatim

Fields
"type": string
"value": string
"content": target
Default HTML template
<code>{{ content }}</code>