Examples¶
Four worked .mdma files, also used as shared test fixtures by the
Python, TypeScript,
and Go implementations.
simple.mdma¶
A minimal single-block template: one input schema, one block, a conditional, and a filter chain.
@inputs
name: string
description: string
tags: string[] = []
draft: boolean = false
<badge-line>
{% if draft -%}**[DRAFT]** {% endif %}{{ name }}{% if tags | length > 0 %} — {{ tags | join(", ") }}{% endif %}
<body>
## {{ name }}
{{ description }}
{% if tags | length > 0 -%}
**Tags:** {{ tags | join(", ") }}
{%- endif %}
release-notes.mdma¶
A multi-block template — slug, title, release-notes (with a breaking-change conditional and
Added/Changed/Fixed sections), and a multiple-modifier changelog-entry block.
@inputs
project: string
version: string
date: string
added: string[] = []
changed: string[] = []
fixed: string[] = []
breaking: boolean = false
releases: object[] = []
<slug>
{{ project }}-{{ version }}
<title>
{{ project }} {{ version }}
<release-notes>
# {{ title }} — {{ date }}
{%- if breaking %}
> **Breaking changes included in this release.**
{%- endif %}
{% if added | length > 0 -%}
### Added
{% for item in added -%}
- {{ item }}
{% endfor -%}
{% endif %}
{% if changed | length > 0 -%}
### Changed
{% for item in changed -%}
- {{ item }}
{% endfor -%}
{% endif %}
{% if fixed | length > 0 -%}
### Fixed
{% for item in fixed -%}
- {{ item }}
{% endfor -%}
{% endif %}
<changelog-entry
multiple: entry in releases
>
### {{ entry.version }} — {{ entry.date }}
{% for item in entry.added -%}
- {{ item }}
{% endfor %}
comments.mdma¶
Shows {# ... #} comments everywhere they're allowed — in the inputs section
(full-line and trailing), between blocks, and inside block bodies. All of them
are stripped at parse time and never reach the rendered output.
@inputs
{# who the page is about #}
name: string
tags: string[] = [] {# optional labels #}
{# ---- blocks below ---- #}
<header>
{# comment lines vanish entirely #}
## {{ name }}
<tag-line>
{% if tags | length > 0 -%}
Tags: {{ tags | join(", ") }}
{%- endif %}
{# {{ this }} is never evaluated #}
named-blocks.mdma¶
Demonstrates multiple + name together — object output keyed by a computed name
(entry.version) instead of array position.