Skip to content

Mustache Template Syntax

Nimbus Markdown templates use the Mustache template language to insert values from the driver model into the pages. Mustache is a widely used, well-documented standard — this page covers the subset Nimbus supports and how Nimbus uses it. For the language itself, the canonical reference is the Mustache manual and spec.

SyntaxNameBehavior in Nimbus
{{value}}VariableInserts the value, HTML-escaped.
{{{value}}}Raw variableInserts the value without HTML-escaping. Use for content that is already HTML/Markdown (custom fields, formatted type names, code).
{{#section}} … {{/section}}SectionRenders the block when the value is truthy; iterates when it is a list (see below).
{{^section}} … {{/section}}Inverted sectionRenders the block only when the value is falsy.
{{! comment }}CommentRemoved from the output.
{{> name}}PartialInserts another named template, rendered with the current context.
{{parent.child.value}}Dotted pathWalks nested properties.
{{.}}Implicit iteratorThe current item itself (useful inside a list of simple values).

A {{#section}} block behaves three ways depending on the value:

  • List → the block is repeated once per item, with each item as the context:

    {{#parameters}}
    ## Parameters
    | Name | Type | Description |
    |------|------|-------------|
    {{#items}}
    | `{{name}}` | {{{typeHtml}}} | {{description}} |
    {{/items}}
    {{/parameters}}
  • Object → the block renders once with that object as the context:

    {{#returnValue}}
    ## Return Value
    {{description}}
    {{/returnValue}}
  • Boolean / simple flag → the block renders once (keeping the current context) when the value is truthy. Pair with an inverted section for an either/or:

    {{#commands}}
    {{#isSingle}}
    ## Instrument Command
    {{/isSingle}}
    {{^isSingle}}
    ## Instrument Commands
    {{/isSingle}}
    {{/commands}}

A section renders (and an inverted section does not) when the value is not any of:

  • null / missing
  • false
  • an empty string
  • an empty list

Everything else is truthy.

Use {{value}} for plain text that should be HTML-escaped (names, descriptions). Use the triple-brace {{{value}}} only when the value is already markup that must pass through unchanged — most commonly custom field content and pre-formatted type links:

{{#customFields.remarks}}
## Remarks
{{{value}}}
{{/customFields.remarks}}

If a template references a value that does not exist on the model, the help build fails with an “Unresolved Mustache tag” error rather than silently rendering nothing. This keeps templates honest — but it means a tag must match a real field in the data model. See Layout Templates for the data available to each layout.

Nimbus implements a focused subset of Mustache. The following standard Mustache features are not available:

  • Lambdas (functions as values)
  • Set delimiters ({{=<% %>=}})
  • Block / helper extensions (Handlebars-style helpers)
  • Partial parameters / inheritance

Anything the supported features cannot express can usually be handled by embedding raw HTML directly in the template.