Overview
Knap is a templating language designed to convert data into Markdown format. It provides a simple syntax for:
- Variable interpolation: Insert data inline with Markdown using
{{ variable }}syntax - Filters: Modify values and formatting using pipe notation (e.g.,
{{ plot | blockquote }}) - Conditional logic: Control content display with
{% if %}statements - Data transformation: Sort, format, and structure data (e.g.,
{{ cast | sort:\\"Actor\\" | table }}) - YAML frontmatter generation: Create metadata with filters like
yaml_property - Wikilink support: Format links for wiki-style systems
Tools and Integration:
- CLI: Command-line tool for rendering templates (
npx knap render template.md --data data.json --output note.md) - API: npm package for integrating Knap into applications
- Obsidian integrations: Powers Web Clipper (save web pages with custom templates) and Importer (convert data from various apps/formats to Markdown)
Creativity Potential
Knap offers significant creative possibilities for knowledge management and content generation:
- Custom workflows: Design personalized templates for capturing web content, research notes, or structured data
- Data visualization: Transform raw data into readable tables, lists, and formatted blocks
- Cross-platform portability: Generate portable Markdown files that work across different tools
- Automated note-taking: Create consistent, structured notes from varied data sources
- Template libraries: Build reusable templates for different content types (movies, articles, recipes, etc.)
- Metadata standardization: Ensure consistent frontmatter across notes for better organization and searchability
(summary generated by AI)
—-
Content
Add variables inline with Markdown. Filters modify values and formatting.
# Turn data into Markdown
# Turn data into Markdown
**Plot:**
# Turn data into Markdown
**Plot:**
>
{% if cast %}
{% endif %}
{% if cast %}
{% endif %}
{% if cast %}
{% endif %}
{% if cast %}
{% endif %}
---
---
---
year:
---
---
year:
---
Generate Markdown from Knap templates. Read the CLI guide for options.
npx knap render template.md --data data.json --output note.md
Add Knap templating to your app using the API.
npm install knap
[
Obsidian Importer
Convert data from many apps and file formats to portable Markdown files.