# Template Markdown Rendering

Renders Markdown notes from templates and JSON or CSV data with the Knap CLI.

- Repository: https://github.com/kepano/obsidian-skills (50569 stars)
- Category: Documents
- License: MIT
- Last updated: 2026-09-15
- Runs scripts: no, instructions only

## Install

Claude Code: `npx skills add kepano/obsidian-skills --skill knap -g -a claude-code -y`
Codex: `npx skills add kepano/obsidian-skills --skill knap -g -a codex -y`
Cursor: `npx skills add kepano/obsidian-skills --skill knap -g -a cursor -y`
Gemini CLI: `npx skills add kepano/obsidian-skills --skill knap -g -a gemini-cli -y`
Claude Code plugin marketplace: `/plugin marketplace add kepano/obsidian-skills`

## Description

Render Markdown from templates and structured data using Knap CLI. Use when the user asks to apply a Knap template, turn JSON or CSV data into notes, batch-generate Markdown files, or format Defuddle output into a note.

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# Knap

Use Knap CLI to render Markdown templates with variables, filters, and logic.

If not installed: `npm install -g knap` (requires Node.js 20 or later). Alternatively, use `npx knap`.

Run `knap --help` for available commands and options. Discover the language through the CLI's offline reference:

```bash
knap help syntax
knap help filters
knap help filter date
knap help tags
knap help tag for
```

Use the lists to find names, then request individual help for syntax, parameters, and examples with expected output.

## Usage

Render a template with JSON variables:

```bash
knap render template.md --data article.json -o note.md
```

Supply a template and data inline:

```bash
knap render -t '# {{ title | trim }}' --data-json '{"title":"Hello"}'
```

Override a variable or pipe JSON data:

```bash
knap render template.md --data article.json --set 'title=Custom title'
cat article.json | knap render template.md --data -
```

Data must be a JSON object; its properties become template variables. `--set` overrides literal top-level keys with strings. Use JSON for nested objects, arrays, numbers, and booleans.

Choose one template source (file, `-t`, or stdin) and one data source (`--data` or `--data-json`). Only one input can read stdin. Without a template file or `-t`, Knap reads the template from stdin.

Output defaults to stdout. `-o` creates parent directories and overwrites the destination after rendering succeeds. Errors exit with status `1`; diagnostics go to stderr. Warnings can accompany successful output.

## Templates

Use `{{ variable }}` for values, `|` for filters, and `{% ... %}` for logic. For example, save this as `template.md`:

```knap
---
{{ title | yaml_property:"title" }}
{{ tags | yaml_property:"tags" }}
---
# {{ title | trim }}
{% if author %}
By {{ author }}
{% endif %}

{{ content }}
```

The rest: https://github.com/kepano/obsidian-skills/blob/HEAD/skills/knap/SKILL.md
