knap

Render Markdown notes from templates and JSON or CSV data using the Knap CLI.

Updated Nov 9, 2023
One-click install
npx skills add https://github.com/oresttokovenko/dot-files --skill knap-oresttokovenko
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: knap
Source: https://github.com/oresttokovenko/dot-files/tree/main/chezmoi/dot_agents/skills/knap
Command: npx skills add https://github.com/oresttokovenko/dot-files --skill knap-oresttokovenko

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires knap.

What problem does it solve? Turning structured data like JSON objects, CSV rows, or web page extractions into consistently formatted Markdown notes usually requires manual copy-pasting or custom scripts. This Skill uses the Knap CLI to render templates with variables, filters, and logic so notes are generated deterministically from data. ## Core Features & Use Cases - Template Rendering: Render Markdown templates with {{ variable }} placeholders, filters like trim and yaml_property, and {% if %} logic, with data supplied from JSON files, inline JSON, or stdin. - Batch Generation: Create one Markdown file per CSV row, JSON array item, or JSON file in a folder, with filename templates, dry-run validation, and overwrite controls. - Defuddle Pipeline: Pipe Defuddle's web page extraction JSON directly into a Knap template to convert articles into formatted notes. - Use Case: Extract an article with defuddle parse <url> --md --json, pipe it into knap render template.md --data - -o note.md, and get a note with proper YAML frontmatter and formatted content. ## Quick Start Ask the assistant to render your JSON data file through a Knap template into a Markdown note, for example by requesting to apply template.md to article.json and save the result as note.md.

Frequently Asked Questions about knap

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I render a Markdown template with JSON data using Knap?

Run knap render template.md --data article.json -o note.md to render a template file with variables from a JSON object. You can also pass inline data with --data-json or pipe JSON through stdin using --data -.

How to generate multiple Markdown files from a CSV file?

Use knap batch template.md --data articles.csv --output-dir notes with a --filename template such as '{{ title | safe_name }}.md'. CSV headers become variable names, and --dry-run lists output paths without writing files.

Can Knap convert web pages into Markdown notes?

Yes, by piping Defuddle output into Knap. Run defuddle parse <url> --md --json and pipe it into knap render template.md --data - so properties like title and content become template variables.

Does Knap support template validation before rendering?

Yes, knap validate template.md checks syntax, filter names, and static filter arguments without data or file output. It does not check variable existence or runtime values, so render with real data to verify runtime behavior.

What are the limitations of Knap template data input?

Data must be a JSON object whose properties become template variables, and --set only overrides top-level keys with strings. Knap does not provide Web Clipper browser variables, selectors, prompts, or DOM-dependent HTML filters.