Files
org-roam/manual/Template-Walkthrough.html
2020-05-13 11:45:38 +00:00

109 lines
4.9 KiB
HTML

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<!-- Copyright (C) 2020-2020 Jethro Kuan <jethrokuan95@gmail.com>
You can redistribute this document and/or modify it under the terms
of the GNU General Public License as published by the Free Software
Foundation, either version 3 of the License, or (at your option) any
later version.
This document is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
-->
<!-- Created by GNU Texinfo 6.5, http://www.gnu.org/software/texinfo/ -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Template Walkthrough (Org-roam User Manual)</title>
<meta name="description" content="Template Walkthrough (Org-roam User Manual)">
<meta name="keywords" content="Template Walkthrough (Org-roam User Manual)">
<meta name="resource-type" content="document">
<meta name="distribution" content="global">
<meta name="Generator" content="makeinfo">
<link href="index.html#Top" rel="start" title="Top">
<link href="index.html#SEC_Contents" rel="contents" title="Table of Contents">
<link href="The-Templating-System.html#The-Templating-System" rel="up" title="The Templating System">
<link href="Org_002droam-Template-Expansion.html#Org_002droam-Template-Expansion" rel="next" title="Org-roam Template Expansion">
<link href="The-Templating-System.html#The-Templating-System" rel="prev" title="The Templating System">
<style type="text/css">
<!--
a.summary-letter {text-decoration: none}
blockquote.indentedblock {margin-right: 0em}
blockquote.smallindentedblock {margin-right: 0em; font-size: smaller}
blockquote.smallquotation {font-size: smaller}
div.display {margin-left: 3.2em}
div.example {margin-left: 3.2em}
div.lisp {margin-left: 3.2em}
div.smalldisplay {margin-left: 3.2em}
div.smallexample {margin-left: 3.2em}
div.smalllisp {margin-left: 3.2em}
kbd {font-style: oblique}
pre.display {font-family: inherit}
pre.format {font-family: inherit}
pre.menu-comment {font-family: serif}
pre.menu-preformatted {font-family: serif}
pre.smalldisplay {font-family: inherit; font-size: smaller}
pre.smallexample {font-size: smaller}
pre.smallformat {font-family: inherit; font-size: smaller}
pre.smalllisp {font-size: smaller}
span.nolinebreak {white-space: nowrap}
span.roman {font-family: initial; font-weight: normal}
span.sansserif {font-family: sans-serif; font-weight: normal}
ul.no-bullet {list-style: none}
-->
</style>
</head>
<body lang="en">
<a name="Template-Walkthrough"></a>
<div class="header">
<p>
Next: <a href="Org_002droam-Template-Expansion.html#Org_002droam-Template-Expansion" accesskey="n" rel="next">Org-roam Template Expansion</a>, Up: <a href="The-Templating-System.html#The-Templating-System" accesskey="u" rel="up">The Templating System</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>]</p>
</div>
<hr>
<a name="Template-Walkthrough-1"></a>
<h3 class="section">5.1 Template Walkthrough</h3>
<p>To demonstrate the additions made to org-capture templates. Here, we walkthrough
the default template, reproduced below.
</p>
<div class="lisp">
<pre class="lisp">(&quot;d&quot; &quot;default&quot; plain (function org-roam--capture-get-point)
&quot;%?&quot;
:file-name &quot;%&lt;%Y%m%d%H%M%S&gt;-${slug}&quot;
:head &quot;#+TITLE: ${title}\n&quot;
:unnarrowed t)
</pre></div>
<ol>
<li> The template has short key &lsquo;<samp>&quot;d&quot;</samp>&rsquo;. If you have only one template,
org-roam automatically chooses this template for you.
</li><li> The template is given a description of &lsquo;<samp>&quot;default&quot;</samp>&rsquo;.
</li><li> &lsquo;<samp>plain</samp>&rsquo; text is inserted. Other options include Org headings via
&lsquo;<samp>entry</samp>&rsquo;.
</li><li> &lsquo;<samp>(function org-roam--capture-get-point)</samp>&rsquo; should not be changed.
</li><li> &lsquo;<samp>&quot;%?&quot;</samp>&rsquo; is the template inserted on each call to &lsquo;<samp>org-roam-capture--capture</samp>&rsquo;.
This template means don&rsquo;t insert any content, but place the cursor
here.
</li><li> &lsquo;<samp>:file-name</samp>&rsquo; is the file-name template for a new note, if it doesn&rsquo;t
yet exist. This creates a file at path that looks like
&lsquo;<samp>/path/to/org-roam-directory/20200213032037-foo.org</samp>&rsquo;.
</li><li> &lsquo;<samp>:head</samp>&rsquo; contains the initial template to be inserted (once only), at
the beginning of the file. Here, the title global attribute is
inserted.
</li><li> &lsquo;<samp>:unnarrowed t</samp>&rsquo; tells org-capture to show the contents for the whole
file, rather than narrowing to just the entry.
</li></ol>
<p>Other options you may want to learn about include &lsquo;<samp>:immediate-finish</samp>&rsquo;.
</p>
</body>
</html>