Available Samples
The following samples are available to help you get started:Basic Samples
Hello World
A simple introduction to TemplateMark with basic variable substitution
Blank Template
Empty template to start from scratch
Business Document Samples
Employment Offer
Professional employment offer letter with salary, dates, and optional probation period
NDA
Non-Disclosure Agreement template with parties, purpose, and duration
Payment Receipt
Detailed payment receipt with VAT calculation and party information
Invitation
Event invitation with date formatting and nested address structure
Feature Demonstration Samples
Customer Order
Complex sample demonstrating clauses, lists, joins, formulas, and date handling
Formula Examples
Demonstrates inline TypeScript formulas for dynamic calculations
Formula with Now
Shows time-based calculations using the
now variableList Operations
Examples of ordered, unordered, and joined lists
Join Lists
Natural language joining of arrays with locale support
Clauses
Demonstrates clause blocks for nested object rendering
Conditional Clauses
Shows conditional rendering based on data properties
Optional Content
Handling optional fields with if/else blocks
Markdown Features
Rich markdown formatting within templates
Announcement
Product announcement template with structured content
Sample Structure
Each sample template consists of three main components:1. MODEL
The model defines the data structure using Concerto modeling language. It specifies:- Namespace and version
- Concept definitions with properties
- Data types and constraints
- Optional fields
- The
@templatedecorator on the main concept
2. TEMPLATE
The template contains:- Markdown-formatted content
- Variable placeholders using
{{variable}}syntax - Formatting expressions like
{{date as "DD MMMM YYYY"}} - Conditional blocks with
{{#if}} - Clauses with
{{#clause}} - Formulas with
{{% return expression %}}
3. DATA
The data object provides:- A
$classproperty specifying the fully-qualified type - Values for all required properties
- Optional values for optional properties
- Nested objects for complex types
Using Samples
To use a sample template:- Copy the model - Define your data structure
- Customize the template - Modify the markdown and variable placeholders
- Provide your data - Create a data object matching your model
- Generate output - Use the TemplateMark engine to render the template
Common Patterns
Across these samples, you’ll see common patterns:- Date Formatting:
{{effectiveDate as "DD MMMM YYYY"}} - Number Formatting:
{{doubleValue as "0,0"}} - Conditional Sections:
{{#if probation}}...{{/if}} - Clauses:
{{#clause address}}...{{/clause}} - Formulas:
{{% return name.length %}} - Lists:
{{#ulist items}}...{{/ulist}} - Joins:
{{#join favoriteColors}}
Next Steps
Hello World Sample
Start with the simplest example
Template Syntax
Learn the complete template syntax
Data Modeling
Understand Concerto data models
API Reference
Explore the API documentation