Use Markdown export templates to choose which text, notes and custom attributes appear in your exported document—and where they appear. Each node type can use its own template or keep Traverse’s standard export.

Get started

  1. Open the document’s Attributes window and add Type if it is not already active.
  2. Choose Markdown Templates… in that window.
  3. Select a node type and turn on Use custom template.
  4. Start with {{nodeText}}, then use Insert Token to add fields or Optional Section to insert a condition.
  5. Check the preview, then choose Apply.

Templates are saved with this document and apply to Markdown Document export. They do not change the text in your outline. Removing Type makes saved templates inactive; adding it again restores their use. Turning a type back to Standard keeps its custom template for later.

Tokens: insert text and attributes

A token is replaced separately for each exported node. Use the field’s key, which may differ from its visible label. Insert Token supplies the correct key.

Token Inserts
{{nodeText}} The node’s main text
{{_note}} Its attached note
{{_price}} The attribute whose key is _price

Use a token more than once if you want its value in multiple places. Values are not evaluated as new template instructions.

Node text and attached notes keep their Markdown. URL-type attributes preserve their links. Other attribute values are escaped as ordinary Markdown text, so characters such as * and [ do not unexpectedly become formatting.

For example, with a Price attribute whose key is _price:

{{nodeText}} — {{_price}}

Standard export and custom templates

The choice applies separately to each node type. Standard follows your Markdown export settings. A custom template controls which attached notes and additional attributes appear: include their tokens to export them, or leave them out to omit them. Include notes and Include additional attributes do not add those fields to a custom template automatically.

Node type What Traverse adds to your template output
Body Normal spacing between nodes
Heading The heading’s # markers and level
List item The bullet or number, task marker when applicable, and indentation for additional lines
Blockquote A > prefix on every output line, including blank lines
Note Your custom output, including any comment markers you write
Code and Divider These always use Standard export

Bullet and numbered items share the List item template. Traverse still controls numbering, including the Preserve numbering option. Draft nodes and their children remain excluded.

Headings

Write only the title in Heading text. It must stay on one line; Traverse supplies the heading markers. Use Content below heading for extra paragraphs, notes or attributes.

Lists and quotes

For a list item, additional template lines are indented beneath that item. Blank lines can separate paragraphs within the item. For a blockquote, a template containing:

{{nodeText}}

{{_note}}

might export:

> A useful idea
>
> A supporting detail.

Note nodes and attached notes

A standalone Note node’s own text is {{nodeText}}. Its separate attached note is {{_note}}.

A custom Note template controls inclusion and formatting even when note export is turned off in Settings. To export Note nodes as comments, for example:

<!-- {{nodeText}} -->

Standard Note nodes continue to follow the note-inclusion and comment-format settings.

Optional sections

Use if to include content only when a condition matches:

{{nodeText}}{{#if _price}} — {{_price}}{{/if}}

A simple if checks:

  • Checkbox: checked. For Task, checked means complete.
  • Other fields: a value is present. Zero counts as a value; whitespace-only text does not.

An optional else supplies a fallback:

{{#if ready}}Ready{{else}}Not ready{{/if}}: {{nodeText}}

Put spaces and punctuation inside the conditional when they should disappear along with its value.

Text comparisons

Compare against text in double quotes:

{{#if size = "Big"}}Large: {{nodeText}}{{else}}{{nodeText}}{{/if}}

Use = or == for equality, or != for a different value. Matching is exact and case-sensitive, including spaces. Missing values compare as empty text. Escape a quote inside the comparison value with \".

Lookup selections

Use contains to check for one complete lookup selection:

{{#if size contains "Big"}}Large: {{nodeText}}{{else}}{{nodeText}}{{/if}}

This matches a lookup containing both Big and Small, regardless of their order. It does not match Bigger or big. A selection containing a comma is still checked as one complete selection.

Missing or empty lookups and fields of other types do not match. The = comparison retains its whole-text meaning: a lookup with Big and Small selected compares as Big, Small, in its stored order.

Numeric comparisons

Use >, >=, <, <=, =, == or !=:

{{#if _price > 20}}Over £20{{else}}Other{{/if}}

These work with Number attributes and numeric text. Write plain numbers with a dot for decimals, without currency symbols or thousands separators. Missing or nonnumeric values do not match, even with !=.

Nested conditions

Conditions can contain other conditions. Each if needs its own /if; else belongs to the nearest open condition.

{{#if size = "Big"}}{{#if ready}}Big and ready{{else}}Big, not ready{{/if}}{{else}}Another size{{/if}}

Whitespace in a template is output too. Use new lines for readability when you also want those lines in the exported content.

Check the previous exported node

Inside a condition, prefix a field key with previous.:

{{#if previous.type = "heading"}}{{noBlankBefore}}{{/if}}{{nodeText}}

This places the current node directly below the previous exported node when that node is a Heading. Presence, checkbox, text, numeric and lookup-membership checks work the same way with previous fields:

{{#if previous.size contains "Big"}}{{inset}}{{/if}}{{nodeText}}

“Previous” means the preceding node that actually contributes content in the current export scope. It follows export order across parents and children, not just siblings. Draft nodes, omitted notes/dividers and empty template output do not become the previous node. The document title is not a node.

The first exported node has no previous node, so all previous-field conditions are false. previous.key is available in conditions only; output tokens still refer to the current node.

Spacing and indentation

Typed spaces, tabs and newlines are preserved within template content. Blank boundary lines at the beginning and end are removed. Normal spacing between nodes is still supplied by Traverse.

The layout options at the bottom of Insert Token provide explicit spacing:

Token Effect
{{inset}} Four spaces at this position; it does not indent later lines automatically
{{lineBreak}} One newline in the Markdown source
{{blankLine}} Two newlines, leaving an empty line between paragraphs
{{noBlankBefore}} Removes the usual blank line before this node, leaving one line break

For an attached note in a separate paragraph:

{{nodeText}}{{#if _note}}{{blankLine}}{{_note}}{{/if}}

For a paragraph that follows the previous node directly when its continuation checkbox is checked:

{{#if continuation}}{{noBlankBefore}}{{/if}}{{nodeText}}

noBlankBefore prints no text. It changes only the gap before this node, leaving internal blank lines and the gap before the next node alone. It has no effect at the start of the export or when the template produces no content.

Layout tokens can be conditional and add to any whitespace already typed. Like typed whitespace, their blank boundary lines are trimmed. For Headings, use line breaks in Content below heading, not Heading text.

A Markdown renderer may display a single source newline as a space. Use a blank line when you want a new paragraph. Four leading spaces can also have Markdown meaning, such as a code block: choose indentation to suit the Markdown you intend to produce. Keep a node as Body for literal indentation without heading, list or quote wrappers.

Format dates

Use the date filter with a Date attribute:

{{due | date: long}}
{{due | date: "d MMM yyyy"}}

Replace due with your field’s key. The presets are short, medium, long, full and iso. The first four follow your locale; iso uses yyyy-MM-dd. {{due | date}} uses Medium.

For a custom pattern, d is the day, MMM the abbreviated month, MMMM the full month and yyyy the calendar year. For example, "dd/MM/yyyy" gives a day/month/year format.

Date-only values keep their calendar day. ISO timestamps use your local time zone. Missing or invalid dates produce no text. A token without a date filter keeps the stored value.

For a URL-type attribute, insert its token on its own:

{{website}}

A bare address stays an address, with spaces and round brackets encoded when needed. A stored Markdown link such as [Example App](https://example.com) is preserved as written, including its label and formatting. String fields still insert ordinary escaped text.

If you want to give the link a different label, use | url to take only the address:

[{{nodeText}}]({{website | url}})

Here, website is the field key and url is the filter. This works even if the stored field already contains a titled Markdown link. Avoid placing a complete titled link inside another link destination.

Put one backslash before the opening braces:

\{{nodeText}}

This exports the literal characters {{nodeText}}; the backslash is removed.

Preview, syntax colours and undo

The preview shows the current export scope, with your draft templates applied. Syntax colours help distinguish conditions, fields, comparisons, filters, quoted values and layout tokens. Colours adapt to light and dark appearance and do not change copied or exported text. Highlighting can appear while syntax is incomplete; validation and the preview determine whether the template is valid.

Undo and Redo in the template editor affect only the current editing session. Use ⌘Z and ⇧⌘Z, or the editor’s buttons. Typing, pasting, token insertion, resets and Standard/Custom changes can be undone across node types, including while a template is invalid.

Cancel discards the draft. Apply saves it as one document change. A new editing session starts with a fresh local history.