-
Notifications
You must be signed in to change notification settings - Fork 66
Documentation is lacking guidance for template usage #229
Copy link
Copy link
Closed
Description
For those unaccustomed to vimscript the usage of the templates feature is difficult to penetrate.
By looking at a past project issue I came up with the following:
let g:wiki_root = '~/data/sync/wiki'
let g:wiki_filetypes = ['md']
let g:wiki_link_extension = '.md'
let g:wiki_link_target_type = 'md'
let g:wiki_global_load = 0
let s:journal_template = g:wiki_root . '/.templates/journal.md'
let s:generic_template = g:wiki_root . '/.templates/generic.md'
let g:wiki_templates = [
\ { 'match_re': '^\d\d\d\d-\d\d-\d\d$',
\ 'source_filename': s:journal_template},
\ { 'match_func': {x -> v:true},
\ 'source_filename': s:generic_template}
\]The file ~/data/sync/wiki/.templates/journal.md exists and is deliberately simple at the moment:
# Heading one
## Todo
## NotesHowever, doing the following does not use the template; the file (2022-06-22.md) comes up blank:
vim +WikiJournal
My ambitions are simple at this time. I want a journal file template that will produce file content like:
# Journal <date>
## Todo
## NotesReactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels