From b1c69b476533f0dc2288c750dd14af9699774d02 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micka=C3=ABl=20Menu?= Date: Sat, 23 Oct 2021 19:24:46 +0200 Subject: [PATCH] Add filename and filename-stem template variables (#91) --- CHANGELOG.md | 4 ++ docs/template-format.md | 34 +++++++------ docs/tool-fzf.md | 2 + internal/adapter/fzf/note_filter.go | 56 +++++++++++---------- internal/core/note.go | 14 ++++++ internal/core/note_format.go | 40 ++++++++------- internal/core/note_format_test.go | 77 ++++++++++++++++------------- 7 files changed, 133 insertions(+), 94 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3100351..630f688 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file. ## Unreleased +### Added + +* New template variables `filename` and `filename-stem` when formatting notes (e.g. with `zk list --format`) and for the [`fzf-line`](docs/tool-fzf.md) config key. + ### Fixed * [#89](https://github.com/mickael-menu/zk/issues/89) Calling `zk index` from outside the notebook (contributed by [@adamreese](https://github.com/mickael-menu/zk/pull/90)). diff --git a/docs/template-format.md b/docs/template-format.md index f559892..5921f86 100644 --- a/docs/template-format.md +++ b/docs/template-format.md @@ -2,22 +2,24 @@ The following variables are available in the templates used when formatting notes, for example with `zk list --format