Knap logo

Knap

Visit

Knap is an MIT template language from Obsidian's CEO that turns JSON data into Markdown with logic, variables, and filters.

Share:
View alternatives

Knap is a template language that turns data into Markdown. The product site is knap.md. The repo obsidianmd/knap is MIT, created 2026-08-21, language TypeScript. On 2026-09-12 GitHub listed 341 stars and 10 forks, last push 2026-09-11. Latest npm release checked the same day was 0.4.2. Steph Ango (kepano), CEO of Obsidian, announced it; r/ObsidianMD's hot list carried the post at about 999 upvotes. It already powers templates in Obsidian Web Clipper and Obsidian Importer.

Compare Obsidian if you wanted the notes app, Markitdown if you needed an agent skill that converts files to Markdown, or Defuddle if you only needed HTML-to-content extraction before templating.

Key Features

  • Markdown-native templates: {{ title }} variables, | filter chains such as blockquote, sort, table, wikilink, yaml_property, plus {% if %} / {% for %} logic.
  • CLI and library: npx knap render template.md --data data.json --output note.md. npm install knap. Node.js 20+. knap validate checks syntax without rendering. knap help filters is an offline catalog.
  • No eval: README says an AST interpreter. It does not execute arbitrary JavaScript.
  • Obsidian-shaped output: YAML frontmatter, [[wikilinks]], and HTML that Markdown hosts already accept.
  • Playground: knap.md/playground renders the same examples as the docs.

Limitation: 341 stars is a heat signal, not an audit. HTML filters such as strip_tags are not sanitizers. The link and image filters omit javascript:, vbscript:, and data: destinations; hosts still need their own protocol policy. DOM-dependent filters need the library API, not the CLI.

Use Cases

  • Clipper and importer authors who want one template language across Obsidian tools.
  • CLI pipelines that take Defuddle or other JSON and write a Markdown note.
  • People who should use Obsidian itself if they only needed a vault, not a templating runtime.

Pricing

Piece Price Notes from first-party pages 2026-09-12
knap language, CLI, npm $0 MIT. About 341 stars. npm knap 0.4.2.
Obsidian host Confirm that product Clipper and Importer are separate.

Getting Started

  1. Open the playground, or npm install knap / npx knap.
  2. Write a template with {{ variables }} and optional {% if %} blocks.
  3. Render: npx knap render template.md --data article.json --output note.md.
  4. Validate without data: npx knap validate template.md.

First-party resource: the docs and the README.

Frequently Asked Questions

Is this an Obsidian plugin?

No. It is a language and npm package. Clipper and Importer already embed it. Any app can npm install knap.

Can it run JavaScript from a template?

No. README: AST interpreter, no eval.

What Node version?

CLI needs Node.js 20 or later. Library imports do not depend on the CLI.

Alternatives

  • Obsidian: the vault that already ships Clipper/Importer templates on Knap.
  • Markitdown: convert files to Markdown inside an agent, not a template language.
  • Mustache / Liquid: general template engines. Knap's filters target Markdown and Obsidian YAML.

Tips

  1. Pipe Defuddle JSON into npx knap render template.md --data - when the source is a URL.
  2. Run knap validate in CI before you render. It does not check whether variables exist.
  3. Treat rendered HTML as untrusted until the host sanitizes it.

Conclusion

Knap is the small MIT language to reach for when JSON should become a Markdown note, especially next to Obsidian Clipper. Start at knap.md, then keep Obsidian in the shortlist if you wanted the vault rather than the templater.

Comments

No comments yet. Be the first to comment!