Skip to content

Examples

Three worked .mdma files, also used as shared test fixtures by the Python and TypeScript 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 %}

named-blocks.mdma

Demonstrates multiple + name together — object output keyed by a computed name (entry.version) instead of array position.

@inputs
releases: object[] = []

<changelog-by-version
multiple: entry in releases
name: entry.version
>

### {{ entry.version }}{{ entry.date }}
{% for item in entry.added -%}
- {{ item }}
{% endfor %}