Next: , Up: The Templating System   [Contents]


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)
  1. The template has short key ‘"d"’. If you have only one template, org-roam automatically chooses this template for you.
  2. The template is given a description of ‘"default"’.
  3. plain’ text is inserted. Other options include Org headings via ‘entry’.
  4. (function org-roam--capture-get-point)’ should not be changed.
  5. "%?"’ 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.
  6. :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’.
  7. :head’ contains the initial template to be inserted (once only), at the beginning of the file. Here, the title global attribute is inserted.
  8. :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’.