Template Engine for Daily Notes
Build a template system that automatically generates notes from templates, with built-in support for daily notes (journaling).
Features
Template Storage
- Store templates as special notes under
templates/ folder:
templates/daily.md — Daily note template
templates/weekly.md — Weekly review template
templates/project.md — Project template
templates/custom/{name}.md — User-defined templates
Template Syntax
Use Handlebars/Mustache-like syntax:
# {{title}}
**Date:** {{date}}
**Week:** {{week_number}}
## Goals
- [ ] Goal 1
- [ ] Goal 2
## Notes
## Tasks
{{#each tasks}}
- [ ] {{this}}
{{/each}}
## Linked Notes
{{#each backlinks}}
- [[{{this}}]]
{{/each}}
Built-in template variables:
{{date}} — Current date (YYYY-MM-DD)
{{time}} — Current time (HH:MM)
{{week_number}} — ISO week number
{{title}} — Note title
{{path}} — Note path
{{tags}} — Comma-separated tags from frontmatter
{{backlinks}} — Notes linking to this note
Daily Notes
POST /notes/daily — Create or open today's daily note
- Daily note path format:
daily/YYYY-MM-DD.md
- Auto-populated from
templates/daily.md
- Configurable daily note folder and template
Template Management API
GET /templates — List all templates
GET /templates/{name} — Get template content
PUT /templates/{name} — Create/update template
DELETE /templates/{name} — Delete template
POST /notes/from-template?template=name&path=target — Create note from template
Configuration
pub struct NoteTemplateConfig {
pub daily_notes_folder: String, // Default: "daily"
pub daily_template: String, // Default: "templates/daily.md"
pub enable_auto_daily: bool, // Auto-create daily note on first write of day
pub custom_delimiter: (String, String), // Template delimiters, default: ("{{", "}}")
}
Acceptance Criteria
Parent Epic
#275
Template Engine for Daily Notes
Build a template system that automatically generates notes from templates, with built-in support for daily notes (journaling).
Features
Template Storage
templates/folder:templates/daily.md— Daily note templatetemplates/weekly.md— Weekly review templatetemplates/project.md— Project templatetemplates/custom/{name}.md— User-defined templatesTemplate Syntax
Use Handlebars/Mustache-like syntax:
Built-in template variables:
{{date}}— Current date (YYYY-MM-DD){{time}}— Current time (HH:MM){{week_number}}— ISO week number{{title}}— Note title{{path}}— Note path{{tags}}— Comma-separated tags from frontmatter{{backlinks}}— Notes linking to this noteDaily Notes
POST /notes/daily— Create or open today's daily notedaily/YYYY-MM-DD.mdtemplates/daily.mdTemplate Management API
Configuration
Acceptance Criteria
{{backlinks}}enumeration worksParent Epic
#275