A template engine for Markdown

Turn structured data into notes worth keeping.

Knap brings variables, logic, loops, and a focused filter library to Markdown—without evaluating arbitrary JavaScript.

reading-note.mdKNAP
1# {{ title | trim | title }}23{% if author %}4By {{ author.name }}5{% endif %}67{% for tag in tags %}8- {{ tag | lower }}9{% endfor %}
Installpnpm add knap
Quick start →

Small language, clear contract

Made for applications that create Markdown.

01

Safe by design

An AST interpreter handles templates. Knap does not use eval or execute arbitrary JavaScript.

02

Application-owned

Your app supplies variables, asynchronous resolvers, and custom filters. Knap stays independent of any host environment.

03

Useful diagnostics

Errors and warnings include stable codes, messages, lines, and columns for editor tooling and helpful user feedback.

Start withVariables{{ title }}Then addLogic{% if author %}Shape withFilters| trim | title