Knap Template Renderer
BetaWrite a Knap template, paste JSON data, and get Markdown. Knap is the Liquid-style template language behind Obsidian Web Clipper and Importer, with 70 Markdown-aware filters for headings, tables, wikilinks and YAML frontmatter. The engine runs in your browser with no eval, and the same renderer is available over the FindUtils API and MCP server.
- Free, no sign-up
- Updated
- Reviewed by Olgun Ozoktas
Renders as you type. The template and the data stay in this tab; nothing is uploaded.
Markdown
Why Render Knap Templates Here?
Knap is a small template language published by the Obsidian team under the MIT licence at knap.md. Its syntax is the familiar one: {{ variable }} for output, a pipe for filters with colon-separated quoted arguments, {% if %} with elseif and else, {% for item in list %} with loop variables, {% set %} for a local value, and {# #} for a comment that never reaches the output. What sets it apart is the filter set, which is written for Markdown: bold, italic, code and code_block, h1 to h6, blockquote, callout, list, table, link, image, wikilink, footnote, yaml and yaml_property, next to the usual text, date, number and collection filters. This page lists every filter in the running engine under the editors, read from the engine's own registry.
The renderer on this page is the knap package itself, loaded in your browser on first use. It is an AST interpreter: templates are parsed into a tree and evaluated, never turned into JavaScript, and the engine runs here with native regular expressions disabled. The link and image filters escape their labels and drop javascript:, vbscript: and data: destinations. A template is capped at 200,000 characters and the output at 1,000,000. Errors come back with a code, a line and a column, and non-fatal problems come back as warnings under the output.
The Preview tab renders the Markdown through the site's own Markdown to HTML converter inside a sandboxed frame that may load nothing from the network, so a template can never run a script or fetch a resource on this page. The Source tab is the exact text that Copy and Download produce. The same renderer is exposed on the FindUtils API and MCP server as knap_render, so a script or an agent can produce Markdown from a JSON object with one call.
How it compares
The knap.md site has a playground of its own, and it is the reference for the language. This page adds three things: a data panel that takes a full JSON object rather than a fixed example, a download of the result as a .md file named after the title, and the same renderer as an API and MCP tool for scripts and agents. Everything else about the language, including every filter's behaviour, is Knap's own; nothing is re-implemented here.
Knap Tips
- Filter arguments use a colon and quotes: {{ date | date:"YYYY-MM-DD" }} and {{ tags | join:", " }}. Chain filters with more pipes: {{ title | trim | upper }}.
- The value on the left of a pipe is the subject. {{ url | link:"Read more" }} makes a link whose destination is url and whose label is the argument.
- Inside {% for item in items %}, loop.index starts at 1, loop.index0 at 0, and loop.first and loop.last are booleans. {% if not loop.last %}, {% endif %} puts a separator between items.
- yaml_property writes a YAML line from a value or a list, and wikilink wraps each item in double brackets, so {{ tags | wikilink | yaml_property:"tags" }} builds a tags: list for frontmatter.
- The table filter reads an array of objects and uses the keys as columns. Sort first with sort:"Key" when the order matters.