5.1 Template Walkthrough
To demonstrate the additions made to org-capture templates. Here, we walkthrough
the default template, reproduced below.
("d" "default" plain (function org-roam--capture-get-point)
"%?"
:file-name "%<%Y%m%d%H%M%S>-${slug}"
:head "#+TITLE: ${title}\n"
:unnarrowed t)
- The template has short key ‘"d"’. If you have only one template,
org-roam automatically chooses this template for you.
- The template is given a description of ‘"default"’.
- ‘plain’ text is inserted. Other options include Org headings via
‘entry’.
- ‘(function org-roam--capture-get-point)’ should not be changed.
- ‘"%?"’ is the template inserted on each call to ‘org-roam-capture--capture’.
This template means don’t insert any content, but place the cursor
here.
- ‘:file-name’ is the file-name template for a new note, if it doesn’t
yet exist. This creates a file at path that looks like
‘/path/to/org-roam-directory/20200213032037-foo.org’.
- ‘:head’ contains the initial template to be inserted (once only), at
the beginning of the file. Here, the title global attribute is
inserted.
- ‘:unnarrowed t’ tells org-capture to show the contents for the whole
file, rather than narrowing to just the entry.
Other options you may want to learn about include ‘:immediate-finish’.