[ARGUMENTS]
----
Content
----- List of nodes
- Block
- Block group
- Block group item
- Condition
- Document
- Footnote
- Footnotes
- Footnotes item
- Header
- Horizontal rule
- Include
- Include image
- Include Mau
- Include raw
- Label
- List
- List item
- Macro
- Macro class
- Macro footnote
- Macro header
- Macro image
- Macro link
- Macro raw
- Macro unicode
- Paragraph
- Paragraph line
- Raw
- Raw line
- Source
- Source line
- Source marker
- Style
- Text
- ToC
- ToC item
- Verbatim
List of nodes
This chapter contains the full documentation of all nodes generated by Mau. For each one of them you will find:
- Description: a simple description of the node.
- Scope: whether the node can be found in a
documentor in aparagraph. It can benestedif this node is created automatically as part of another node. - Supports: features available for this node. Can include labels, control flow (
@if), and argument types (boxed or inline). Only listed for document-scope nodes. - Syntax: a description of the syntax used to create the node.
- Templates: the base template name for this node (see chapter 23 for template naming and selection).
- Custom template fields: fields exposed via
custom_template_fieldsthat enable specialised template names. Only listed for nodes that have them. - Fields: the variables passed to the Jinja template.
Fields have a name, a type, and a description. Type is one of
bool: a Python boolean.int: a Python integer.list[type]: a list of values of the given type.dict: a dictionary.str: a Python string that contains pure text.TARGET: text in the target format. For example when rendering in HTML a field of typeTARGETwill contain HTML.NODE: a nested node, rendered by its own template.
Every node receives the following fields, which won't be repeated for each one of them
_type: strThe node type.args: list[str]The positional arguments.kwargs: dictThe keyword arguments.tags: list[str]The tags.internal_tags: list[str]The internal tags.subtype: strThe subtype of the node.
To simplify the use of this chapter, nodes are listed in alphabetical order.
Block
Description: This node represents a generic block. Blocks can isolate text and process it in several different ways depending on the engine.
Scope: document
Supports: labels, control, boxed arguments
Syntax:
Fences are made of any 4 identical characters except //// (which denotes a multi-line comment).
Templates: block
Fields:
classes: list[str]A list of classes assigned to this block.content: TARGETThe rendered content of the block.labels: dictDictionary of labels attached to this block.
Block group
Description: A set of blocks belonging to the same group, each with a position. This node accepts boxed or inline arguments (but not both simultaneously).
Scope: document
Supports: labels, control, boxed and inline arguments
Syntax:
With inline arguments:
<< blockgroup:GROUP_NAMEor with boxed arguments:
[group=GROUP_NAME]
<< blockgroupTemplates: blockgroup
Custom template fields: name (the group name). For example, the template blockgroup.name__example.html matches a block group named example.
Fields:
name: strThe name of the group.items: dictA dictionary where each key is a position name and the value is the rendered block group item at that position.labels: dictDictionary of labels.
Block group item
Description: This node represents a single block within a block group. It is created automatically when blocks with group and position arguments are collected into a group.
Scope: nested
Templates: blockgroup-item
Custom template fields: position (the position name). For example, the template blockgroup-item.position__code.html matches an item at position code.
Fields:
position: strThe position name within the group.block: dictThe nested block data (includingclasses,content,labels).
Condition
Description: This node represents a conditional logic statement. It is created automatically when control conditions are parsed.
Scope: nested
Fields:
variable: strThe variable being tested.comparison: strThe comparison operator (==,!=).value: strThe value being compared against.
Document
Description: The root node that wraps the entire document.
Scope: document
Templates: document
Fields:
content: TARGETThe rendered content of the document.
Footnote
Description: This node represents a footnote definition, created by a block with the footnote argument.
Scope: nested
Syntax:
[footnote=NAME]
----
Footnote content.
----Templates: footnote
Fields:
name: strThe unique name of the footnote.public_id: strThe public-facing identifier (typically a number).internal_id: strThe internal unique identifier.content: TARGETThe rendered content of the footnote.
Footnotes
Description: This node represents the list of all footnote definitions in the document. This node accepts boxed or inline arguments (but not both simultaneously).
Scope: document
Supports: labels, control, boxed and inline arguments
Syntax:
<< footnotesor with boxed arguments:
[*mysubtype]
<< footnotesTemplates: footnotes
Fields:
footnotes: list[NODE]The list of footnotes items.labels: dictDictionary of labels.
Footnotes item
Description: This node represents a single entry in the footnotes list. It is created automatically for each footnote.
Scope: nested
Templates: footnotes-item
Fields:
footnote: dictThe nested footnote data (includingname,public_id,internal_id,content).
Header
Description: This node represents a header. Headers are given an automatic internal ID that can be used for cross-references. The ID can be overridden with the name argument.
Scope: document
Supports: labels, control, boxed arguments
Syntax:
= Header level 1
== Header level 2
=== Header level 3With boxed arguments:
[name=my-header]
= Header level 1Templates: header
Fields:
level: intThe level of the header (1 being the highest).internal_id: strThe unique anchor ID.name: strThe custom name if provided via[name=...].content: TARGETThe rendered text of the header.labels: dictDictionary of labels.
Horizontal rule
Description: This node inserts a horizontal rule.
Scope: document
Supports: labels, control, boxed arguments
Syntax:
---With boxed arguments:
[*special]
---Templates: horizontal-rule
Fields:
labels: dictDictionary of labels.
Include
Description: This node represents generic included content. This node accepts boxed or inline arguments (but not both simultaneously).
Scope: document
Supports: labels, control, boxed and inline arguments
Syntax:
With inline arguments:
<< type:urior with boxed arguments:
[uri]
<< typeTemplates: include
Custom template fields: ctype (the content type). For example, the template include.ctype__csv.html matches an include with content type csv.
Fields:
ctype: strThe type of the included content.labels: dictDictionary of labels.
Include image
Description: This node represents an image included in the document as a stand-alone element. This node accepts boxed or inline arguments (but not both simultaneously).
Scope: document
Supports: labels, control, boxed and inline arguments
Syntax:
With inline arguments:
<< image:path/to/image.pngor with boxed arguments:
[uri=path/to/image.png, alt_text="My alt text"]
<< imageTemplates: include-image
Fields:
uri: strThe URI of the image file.alt_text: strAlternative text.classes: list[str]List of CSS classes.labels: dictDictionary of labels.
Include Mau
Description: This node represents an included Mau file. The file is parsed and its content is merged into the document. This node accepts boxed or inline arguments (but not both simultaneously).
Scope: document
Supports: labels, control, boxed and inline arguments
Syntax:
With inline arguments:
<< mau:path/to/file.mauor with boxed arguments:
[uri=path/to/file.mau]
<< mauTemplates: include-mau
Fields:
uri: strThe path to the included file.content: TARGETThe rendered content of the included file.labels: dictDictionary of labels.
Include raw
Description: This node represents an included file whose content is treated as raw text. This node accepts boxed or inline arguments (but not both simultaneously).
Scope: document
Supports: labels, control, boxed and inline arguments
Syntax:
With inline arguments:
<< raw:path/to/file.txtor with boxed arguments:
[uri=path/to/file.txt]
<< rawTemplates: include-raw
Fields:
uri: strThe path to the included file.content: TARGETThe raw content.labels: dictDictionary of labels.
Label
Description: This node represents a label attached to a document node. Labels provide metadata such as titles or citations.
Scope: nested
Syntax:
.role Contentplaced before the node it labels.
Templates: label
Custom template fields: role (the label role). For example, the template label.role__title.html matches a label with role title.
Fields:
role: strThe label role (e.g.title,cite).content: TARGETThe rendered content of the label.
List
Description: This node represents a list of items. The list can be ordered or unordered.
Scope: document
Supports: labels, control, boxed arguments
Syntax:
* Unordered item
* Unordered item
# Ordered item
# Ordered itemWith boxed arguments:
[*warning, start=3]
# Ordered item
# Ordered itemTemplates: list
Fields:
ordered: boolWhether the list is ordered.main_node: boolWhether this is the main list (not a nested sublist).start: intThe starting number for ordered lists.content: TARGETThe rendered list items.labels: dictDictionary of labels.
List item
Description: This node represents a single item in a list.
Scope: nested
Templates: list-item
Fields:
level: intThe nesting level (1 is the first level).content: TARGETThe rendered content of this item.
Macro
Description: This node represents a generic custom macro. It is created when a macro name does not match any built-in macro.
Scope: paragraph
Syntax: [name](args)
Templates: macro
Custom template fields: name (the macro name). For example, the template macro.name__badge.html matches a custom macro called badge.
Fields:
name: strThe macro name.
Macro class
Description: This node applies one or more CSS classes to a piece of text.
Scope: paragraph
Syntax: [class]("text", class1, class2)
Templates: macro-class
Fields:
classes: list[str]The list of classes.content: TARGETThe rendered content.
Macro footnote
Description: This node represents a reference to a footnote within text.
Scope: paragraph
Syntax: [footnote](NAME)
Templates: macro-footnote
Fields:
footnote: dictThe nested footnote data (includingname,public_id,internal_id,content).
Macro header
Description: This node represents an internal link to a header in the document.
Scope: paragraph
Syntax: [header](NAME, "text")
Templates: macro-header
Fields:
target_name: strThe name of the target header.header: dictThe nested header data (includinglevel,internal_id,content).content: TARGETThe link text (defaults to the header text if not specified).
Macro image
Description: This node represents an inline image within text.
Scope: paragraph
Syntax: [image]("uri", alt_text, width, height)
Templates: macro-image
Fields:
uri: strThe URI of the image.alt_text: strAlternative text.width: strThe width of the image.height: strThe height of the image.
Macro link
Description: This node represents a hyperlink. The [mailto] macro also creates this node, automatically prefixing the target with mailto:.
Scope: paragraph
Syntax: [link](TARGET, "text") or [mailto](EMAIL, "text")
Templates: macro-link
Fields:
target: strThe target URL (ormailto:address for email links).content: TARGETThe rendered link text.
Macro raw
Description: This node represents raw inline content that is not processed by Mau.
Scope: paragraph
Syntax: [raw]("content")
Templates: macro-raw
Fields:
value: strThe raw content.
Macro unicode
Description: This node represents a Unicode code point.
Scope: paragraph
Syntax: [unicode](CODE_POINT)
Templates: macro-unicode
Fields:
value: strThe Unicode code point (e.g.,1F30B).
Paragraph
Description: This node represents a paragraph of text made of one or more lines.
Scope: document
Supports: labels, control, boxed arguments
Syntax: Any line of text that doesn't match another document node.
With boxed arguments:
[*warning]
This is a warning paragraph.Templates: paragraph
Fields:
content: TARGETThe rendered paragraph lines.labels: dictDictionary of labels.
Paragraph line
Description: This node represents a single line within a paragraph.
Scope: nested
Templates: paragraph-line
Fields:
content: TARGETThe rendered inline content of the line.labels: dictDictionary of labels.
Raw
Description: This node represents a block of raw (unprocessed) text, generated by blocks with engine=raw.
Scope: document
Supports: labels, control, boxed arguments
Syntax:
[engine=raw]
----
Content that is included verbatim.
----Templates: raw
Fields:
classes: list[str]A list of classes assigned to this block.content: TARGETThe raw content.labels: dictDictionary of labels.
Raw line
Description: This node represents a single line of raw content. It is created automatically inside raw blocks.
Scope: nested
Templates: raw-line
Fields:
value: strThe raw line of text.
Source
Description: This node represents a source code block, generated by blocks with engine=source.
Scope: document
Supports: labels, control, boxed arguments
Syntax:
[engine=source, language=python]
----
def hello():
pass
----or with the alias
[@source, python]
----
def hello():
pass
----Templates: source
Fields:
language: strThe programming language.classes: list[str]A list of classes assigned to this block.content: list[NODE]The list of source line nodes.labels: dictDictionary of labels.
Source line
Description: This node represents a single line of source code. It is created automatically inside source blocks.
Scope: nested
Templates: source-line
Fields:
line_number: strThe line number.line_content: strThe line of source code.highlight_style: strThe highlight style (if any, e.g.added,removed).marker: NODEThe source marker node (if any).
Source marker
Description: This node represents a marker annotation attached to a source code line.
Scope: nested
Templates: source-marker
Fields:
value: strThe marker label.
Style
Description: This node represents styled text. The style field determines the type of styling applied.
Scope: paragraph
Syntax:
*text*- stylestar_text_- styleunderscore^text^- stylecaret~text~- styletilde
Templates: style
Custom template fields: style (the style type). For example, the template style.style__star.html matches *bold* text.
Fields:
style: strThe style type (star,underscore,caret,tilde).content: TARGETThe rendered styled content.
Text
Description: This node represents plain text.
Scope: paragraph
Templates: text
Fields:
value: strThe text content.
ToC
Description: This node represents the Table of Contents, collecting all headers in the document. This node accepts boxed or inline arguments (but not both simultaneously).
Scope: document
Supports: labels, control, boxed and inline arguments
Syntax:
<< tocor with boxed arguments:
[*mysubtype]
<< tocTemplates: toc
Fields:
plain_entries: list[NODE]A flat list of all headers.nested_entries: list[NODE]A hierarchical list of ToC items.labels: dictDictionary of labels.
ToC item
Description: This node represents a single entry in the Table of Contents. It is created automatically.
Scope: nested
Templates: toc-item
Fields:
header: dictThe nested header data (includinglevel,internal_id,content).entries: list[NODE]Nested ToC items (children of this header).
Verbatim
Description: This node represents verbatim (inline code) text.
Scope: paragraph
Syntax: `text`
Templates: verbatim
Fields:
value: strThe verbatim text.