getting-started.md

May 11, 2026 ยท View on GitHub

{% raw %}

5-Minute Setup

  1. Install prerequisites:

    • Node.js 22.12+ or 24.x
    • pnpm 8.15.0
  2. Clone and install dependencies:

    corepack enable
    corepack prepare pnpm@8.15.0 --activate
    pnpm install
    pnpm build
    
  3. Create a template file hello.md.tmpl:

    # Hello {{ user.name }}
    
    Items:
    {% for item in items %}
    - {{ item }}
    {% endfor %}
    
  4. Create a data file data.json:

    {
      "user": { "name": "Ada" },
      "items": ["One", "Two", "Three"]
    }
    
  5. Render from CLI:

    From monorepo root (development):

    node src/packages/cli/dist/cli.js render -t hello.md.tmpl -i data.json
    

    After publishing (end users):

    npx @templjs/cli render -t hello.md.tmpl -i data.json
    

Core Library Quick Start

import { renderTemplate } from '@templjs/core';

const output = renderTemplate('Hello {{ user.name }}', {
  user: { name: 'Ada' },
});

console.log(output);

Architecture & Source

Design context (ADRs):

Implementation references:

VS Code Setup

  1. Install the templjs VS Code extension package in this repository.

  2. Prefer the .tmpl suffix when creating template files:

    • .md.tmpl, .json.tmpl, .yaml.tmpl, .html.tmpl
  3. Compatibility suffixes remain supported when needed:

    • .md.templ, .json.templ, .yaml.templ, .html.templ
    • .md.tpl, .json.tpl, .yaml.tpl, .html.tpl
  4. Optionally configure schema-aware authoring:

    {
      "templjs.schemaPath": ".templjs/frontmatter.schema.json",
      "templjs.contentSchemaPath": ".templjs/content.schema.json",
      "templjs.schemas": {
        "backlog/**": {
          "schemaPath": ".templjs/work-item.frontmatter.schema.json",
          "contentSchemaPath": ".templjs/work-item.content.schema.json"
        }
      }
    }
    

Next Steps

{% endraw %}