Labels

How to define labels

You can store a single line of formatted text as a label under a given role using the syntax .ROLE LABEL. Labels are not rendered directly, but attached to the next document node. In the documentation of each node, you will find the list of labels it supports and the role they have in the rendering.

Mau source code
.details This is a label with role "details"

The label above will be attached to this paragraph.

How to use labels

Labels are stored inside a node an are available for the visitor to be inserted in the rendered text. The way they are used, however, depends entirely on the template. While the template engine is a topic for a later chapter, it is worth showing here that labels can be rendered. The following example uses a custom template for a paragraph that attaches all labels as a list under it.

Mau source code
.details Some details
The labels above will be attached to this paragraph and rendered in a list below (thanks to a custom template).

  • details: Some details

Multiple labels

You can define as many labels as you want with different roles.

Mau source code
.notes Some notes
.details Some details
The labels above will be attached to this paragraph and rendered in a list below (thanks to a custom template).

  • notes: Some notes
  • details: Some details

Labels and styled text

Labels can contain Mau syntax just like normal paragraphs.

Mau source code
.details This is *a label* with _styles_
The labels above will be attached to this paragraph and rendered in a list below (thanks to a custom template).

  • details: This is a label with styles

Default role

The default role for a label is title, so you can add a title in two different ways.

Mau source code
.title This is a title
This paragraph shows the labels attached to it thanks to a custom template.

. This is also a title
This paragraph shows the labels attached to it thanks to a custom template.

  • title: This is a title

  • title: This is also a title

Blank lines

There can be any amount of blank lines between the label and the node it is attached to.

Mau source code
.title This is a title
This paragraph shows the labels attached to it thanks to a custom template.



.title This is a title

This paragraph shows the labels attached to it thanks to a custom template.



.title This is a title


This paragraph shows the labels attached to it thanks to a custom template.

  • title: This is a title

  • title: This is a title

  • title: This is a title

Multiple labels with the same role

Labels are stored in a buffer and attached to the first document node that appears after them. The label buffer contains one single slot per role, so defining two labels with the same role results in the second definition overwriting the first.

Mau source code
.details This is the first label
.details This overwrites the previous label
.title This doesn't overwrite any label
This paragraph shows the labels attached to it thanks to a custom template.

  • details: This overwrites the previous label
  • title: This doesn't overwrite any label