Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/accordproject/template-playground/llms.txt

Use this file to discover all available pages before exploring further.

Basic Variable Syntax

Variables in TemplateMark are enclosed in double curly braces and reference properties from your data model.
{{variableName}}

Simple Variables

Access top-level properties directly by name:
Hello {{name}}!
Example with data:
{
  "$class": "hello@1.0.0.HelloWorld",
  "name": "John Doe"
}

Nested Object Properties

Access nested properties using dot notation:
{{#clause address}}
{{line1}},
{{city}}, {{state}},
{{country}}
{{/clause}}
Example with nested data:
{
  "$class": "hello@1.0.0.Customer",
  "address": {
    "line1": "1 Main Street",
    "city": "Boston",
    "state": "MA",
    "country": "USA"
  }
}

Date Formatting

Format date and time values using the as keyword with format strings:
{{dateVariable as "FORMAT_STRING"}}

Common Date Formats

{{effectiveDate as "DD MMMM YYYY"}}
Output: 01 February 2025
Example in context:
{
  "$class": "org.accordproject.nda@0.0.2.NDA",
  "effectiveDate": "2025-02-01T00:00:00Z",
  "disclosingParty": "Tech Innovators Inc."
}

Number Formatting

Format numeric values using the as keyword with numeral.js format patterns:
{{numberVariable as "FORMAT_PATTERN"}}

Common Number Formats

{{amount as "0,0.00"}}
Output: 1,250.00
Example in context:
{
  "$class": "payment@1.0.0.PaymentReceipt",
  "amount": 250.00,
  "currency": "USD",
  "vatPercent": 10
}

Special Variables

The now Variable

TemplateMark provides an implicit now variable representing the current date and time:
Today is {{% return now.toISOString() %}}.
The now variable is only accessible within formula expressions (between {{% %}}).

The this Variable

Within list iterations and clause blocks, use this to reference the current item:
{{#ulist items}}
- {{this}}
{{/ulist}}
See the Lists documentation for more details.

Best Practices

Choose variable names that clearly indicate their purpose:
Good: {{customerName}}, {{invoiceDate}}
Avoid: {{x}}, {{data1}}
Raw date values are not human-readable. Always use the as formatter:
Good: {{eventDate as "D MMMM YYYY"}}
Avoid: {{eventDate}}
Use consistent number formatting for currency values:
{{amount as "0,0.00"}} {{currency}}

Conditionals

Learn about conditional rendering based on variable values

Formulas

Perform calculations and transformations on variables

Lists

Iterate over array variables

Build docs developers (and LLMs) love