Knap playground online
Drop a knap template and render it against JSON variables — live, entirely in your browser. Edit either side and watch the Markdown re-render. Nothing is uploaded.
Drop your template (.knap or .md) anywhere on this page
knap runs entirely in your browser. Templates and variables never leave your device.
knap is the template language the Obsidian team open-sourced in 2026, shared by Web Clipper and Importer. If you have ever written a Twig or Liquid template, you already know the shape of it: {{ variable | filter }} prints a value through a filter, {% if %}/{% for %} handle logic, {# #} is a comment, and the output is Markdown. A template turns structured data — the properties of a clipped web page, an imported note’s frontmatter — into a finished note.
Most ways of trying knap involve installing something: Obsidian, the Web Clipper, or the knap CLI (Node 20+). This playground is the zero-install path — and, unlike upload-based template testers, your template and variables are rendered on your own device. The knap engine is a pure TypeScript interpreter (no eval, no server round-trip) that this page downloads as code and runs in the tab; the template you drop never leaves your browser. You can verify that in DevTools, or disconnect from the network after the page loads and keep rendering.
How the playground works
Three panes, one loop: edit either input, the output re-renders (after a short pause for your keystrokes).
- Drop a template anywhere on this page (
.knap, or a.md/.twig/.liquidfile, then pick Knap in the viewer switcher), or click Load an example template above. - The template pane is a full editor with knap syntax highlighting. Errors and warnings from the engine appear as inline markers — a missing
{% endif %}points at the line, an unknown filter names itself. - The variables pane is JSON, auto-scaffolded: every variable the template reads starts as an empty string. Fill in values — strings, numbers, booleans, lists, nested objects — and the output follows. Broken JSON freezes the last good render and tells you why.
- The output pane is the rendered Markdown, as text. Copy it or download it as
.mdfrom the viewer’s status bar. Template edits are session drafts — nothing is ever written back to your file.
Why client-side matters for a template playground
A template you are drafting often carries exactly the data you would rather not hand to a third party: clipped intranet pages, draft notes, customer names, internal URLs. On an upload-based tester, every keystroke sends that material to someone else’s server.
Here the engine — knap, MIT-licensed — runs as WebAssembly-free plain JavaScript in your tab. Open DevTools (F12), watch the Network tab, and drop a template: you will see the one-time engine fetch and no request containing your file. This is the same stance the whole site takes — see why client-side is safer than uploading.
Honest limits
Real capability, real boundaries — stated up front.
- The output is Markdown text, not rendered HTML. knap templates can emit raw HTML, and knap does not sanitize it — by design, hosts are told to sanitize. Rather than ship an HTML preview with a sanitizer to trust, this playground shows the exact bytes the template produces. What you copy is what knap rendered.
- There is no official `.knap` extension. knap templates are plain text — in Obsidian they are usually
.mdfiles..knapis this site’s convention so a dropped template opens the playground directly; a.mdtemplate reaches the same viewer via the viewer switcher. - The filter set is fixed. All of knap’s standard filters are available (
date,truncate,title,yaml,callout, …), plus the DOM-dependent HTML filters (html_to_json,remove_html). Custom filters need a host integration — that is what Obsidian’s apps provide and a web playground cannot. - Render limits apply. The engine caps template size (1 MB), output size, and operation count so a runaway template cannot freeze the tab; hitting a cap shows an inline diagnostic rather than a hung page.
- Edits are session-local. The template pane is a draft surface — closing the tab or switching files discards edits. Download your work when you like what you see.
Credits
The engine is knap by the Obsidian team, MIT-licensed, running unmodified in your browser. This playground adds the editor, the variables scaffolding, and the download plumbing — knap does the templating.
Frequently asked questions
What is knap?
knap is a template language for creating Markdown, open-sourced by Obsidian in 2026. It is shared by Obsidian Web Clipper and Obsidian Importer, so a template written once defines how both tools turn structured data (clipped pages, imported notes) into notes. Syntax is Twig/Liquid-style: {{ variable | filter }}, {% if %}, {% for %}, {# comments #}.
Is there a .knap file extension?
No official one — knap templates are plain text, and in Obsidian they are usually .md files. The .knap extension used on this site is a convention so a dropped template opens the playground immediately; a .md template gets the same viewer through the viewer switcher.
Does this knap playground upload my templates?
No. The knap engine runs entirely in your browser — templates and variables are rendered on your device and never transmitted. The only network fetch is the engine code itself, downloaded once (a few hundred KB) and cached. Verify it yourself in DevTools: the Network tab shows no request containing your file.
Can the output be previewed as HTML?
Deliberately not. knap produces Markdown that can contain raw, unsanitized HTML from the template or the variables, and knap’s own documentation tells hosts to sanitize before rendering. This playground shows the rendered Markdown as text — exactly what you would paste into Obsidian — instead of trusting a sanitizer with untrusted HTML. The DOM-dependent filters (html_to_json, remove_html) still work; their output is text too.
What do knap variables look like?
A JSON object. Each key is a top-level variable the template can read: strings, numbers, booleans, lists (for {% for %} loops), or nested objects (accessed as post.title). The playground auto-scaffolds the object — every variable the template references appears as an empty string, so you only fill in values.
Can I use custom knap filters?
Not here. This playground exposes knap’s standard filter set plus the browser-side HTML filters — custom filters are a host-integration feature (that is how Web Clipper and Importer extend it). Anything in the standard set works: date, truncate, title, upper, join, where, yaml, callout, wikilink, and the rest.
Is this free?
Yes — rendering knap templates here is completely free, with no account and no install. The engine download is one-time and cached by your browser.