summaryrefslogtreecommitdiff
path: root/jt.md
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2021-04-08 08:24:40 +0300
committerLars Wirzenius <liw@liw.fi>2021-04-08 09:37:21 +0300
commitfc917bf829c8a7cbf950754abc7085ffb00dbf17 (patch)
treedebaa476835926b80af97d47d4df6c7a72c2e0c7 /jt.md
parent518e7dc2d5f97387702af0a300cc2842bd0deec6 (diff)
downloadjt2-fc917bf829c8a7cbf950754abc7085ffb00dbf17.tar.gz
feat! add support for tera templates for new journal entries
There is a hardcoded default template, plus one can be overridden per journal by adding a .config/templates/new_entry file in the journal.
Diffstat (limited to 'jt.md')
-rw-r--r--jt.md22
1 files changed, 22 insertions, 0 deletions
diff --git a/jt.md b/jt.md
index 9ee4d1d..1b80c5d 100644
--- a/jt.md
+++ b/jt.md
@@ -224,6 +224,28 @@ then there are no drafts in jrnl
+## Override template for new journal entries
+
+Verify that we can have a custom template for new journal entries.
+
+~~~scenario
+given an installed jt
+
+when I run jt2 --dirname jrnl init default "My test journal"
+then command is successful
+
+given file jrnl/.config/templates/new_entry from new_entry_template
+
+when I run jt2 --editor=none --dirname=jrnl new "Abracadabra"
+then command is successful
+and there is one draft in jrnl
+and draft 0 in jrnl contains "custom new entry template"
+~~~
+
+~~~{#new_entry_template .file .numberLines}
+This is a custom new entry template.
+~~~
+
# Colophon
This document is meant to be processed with the [Subplot][] program to