Files
org-roam/manual.html
2021-07-18 06:39:56 +00:00

2498 lines
130 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<!-- Copyright (C) 2020-2021 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.7, http://www.gnu.org/software/texinfo/ -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Org-roam User Manual</title>
<meta name="description" content="Org-roam User Manual">
<meta name="keywords" content="Org-roam User Manual">
<meta name="resource-type" content="document">
<meta name="distribution" content="global">
<meta name="Generator" content="makeinfo">
<link href="#Top" rel="start" title="Top">
<link href="#Keystroke-Index" rel="index" title="Keystroke Index">
<style type="text/css">
<!--
a.summary-letter {text-decoration: none}
blockquote.indentedblock {margin-right: 0em}
div.display {margin-left: 3.2em}
div.example {margin-left: 3.2em}
div.lisp {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}
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>
<link rel="stylesheet" type="text/css" href="assets/page.css">
</head>
<body lang="en">
<h1 class="settitle" align="center">Org-roam User Manual</h1>
<span id="Top"></span><div class="header">
<p>
Next: <a href="#Introduction" accesskey="n" rel="next">Introduction</a> &nbsp; [<a href="#Keystroke-Index" title="Index" rel="index">Index</a>]</p>
</div>
<span id="Org_002droam-User-Manual"></span><h1 class="top">Org-roam User Manual</h1>
<p>This manual is for Org-roam version 2.0.0.
</p>
<blockquote>
<p>Copyright (C) 2020-2021 Jethro Kuan &lt;jethrokuan95@gmail.com&gt;
</p>
<p>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.
</p>
<p>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.
</p>
</blockquote>
<table class="menu" border="0" cellspacing="0">
<tr><td align="left" valign="top">&bull; <a href="#Introduction" accesskey="1">Introduction</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">&bull; <a href="#Target-Audience" accesskey="2">Target Audience</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">&bull; <a href="#A-Brief-Introduction-to-the-Zettelkasten-Method" accesskey="3">A Brief Introduction to the Zettelkasten Method</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">&bull; <a href="#Installation" accesskey="4">Installation</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">&bull; <a href="#Getting-Started" accesskey="5">Getting Started</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">&bull; <a href="#The-Org_002droam-Buffer" accesskey="6">The Org-roam Buffer</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">&bull; <a href="#Node-Properties" accesskey="7">Node Properties</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">&bull; <a href="#Completion" accesskey="8">Completion</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">&bull; <a href="#Encryption" accesskey="9">Encryption</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">&bull; <a href="#Org_002droam-Protocol">Org-roam Protocol</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">&bull; <a href="#The-Templating-System">The Templating System</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">&bull; <a href="#Graphing">Graphing</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">&bull; <a href="#Org_002droam-Dailies">Org-roam Dailies</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">&bull; <a href="#Performance-Optimization">Performance Optimization</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">&bull; <a href="#The-Org_002dmode-Ecosystem">The Org-mode Ecosystem</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">&bull; <a href="#FAQ">FAQ</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">&bull; <a href="#Migrating-from-Org_002droam-v1">Migrating from Org-roam v1</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">&bull; <a href="#Developer_0027s-Guide-to-Org_002droam">Developer's Guide to Org-roam</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">&bull; <a href="#Appendix">Appendix</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">&bull; <a href="#Keystroke-Index" rel="index">Keystroke Index</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">&bull; <a href="#Command-Index" rel="index">Command Index</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">&bull; <a href="#Function-Index" rel="index">Function Index</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">&bull; <a href="#Variable-Index" rel="index">Variable Index</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><th colspan="3" align="left" valign="top"><pre class="menu-comment">
</pre></th></tr><tr><th colspan="3" align="left" valign="top"><pre class="menu-comment">&mdash; The Detailed Node Listing &mdash;
Installation
</pre></th></tr><tr><td align="left" valign="top">&bull; <a href="#Installing-from-MELPA">Installing from MELPA</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">&bull; <a href="#Installing-from-Apt">Installing from Apt</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">&bull; <a href="#Installing-from-Source">Installing from Source</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">&bull; <a href="#Installation-Troubleshooting">Installation Troubleshooting</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><th colspan="3" align="left" valign="top"><pre class="menu-comment">
Installation Troubleshooting
</pre></th></tr><tr><td align="left" valign="top">&bull; <a href="#C-Compiler">C Compiler</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><th colspan="3" align="left" valign="top"><pre class="menu-comment">
Getting Started
</pre></th></tr><tr><td align="left" valign="top">&bull; <a href="#The-Org_002droam-Node">The Org-roam Node</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">&bull; <a href="#Links-between-Nodes">Links between Nodes</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">&bull; <a href="#Setting-up-Org_002droam">Setting up Org-roam</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">&bull; <a href="#Customizing-Node-Caching">Customizing Node Caching</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">&bull; <a href="#Creating-and-Linking-Nodes">Creating and Linking Nodes</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><th colspan="3" align="left" valign="top"><pre class="menu-comment">
The Org-roam Buffer
</pre></th></tr><tr><td align="left" valign="top">&bull; <a href="#Navigating-the-Org_002droam-Buffer">Navigating the Org-roam Buffer</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">&bull; <a href="#Configuring-what-is-displayed-in-the-buffer">Configuring what is displayed in the buffer</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">&bull; <a href="#Configuring-the-Org_002droam-buffer-display">Configuring the Org-roam buffer display</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">&bull; <a href="#Styling-the-Org_002droam-buffer">Styling the Org-roam buffer</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><th colspan="3" align="left" valign="top"><pre class="menu-comment">
Node Properties
</pre></th></tr><tr><td align="left" valign="top">&bull; <a href="#Standard-Org-properties">Standard Org properties</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">&bull; <a href="#Titles-and-Aliases">Titles and Aliases</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">&bull; <a href="#Tags">Tags</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">&bull; <a href="#Refs">Refs</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><th colspan="3" align="left" valign="top"><pre class="menu-comment">
Completion
</pre></th></tr><tr><td align="left" valign="top">&bull; <a href="#Completing-within-Link-Brackets">Completing within Link Brackets</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">&bull; <a href="#Completing-anywhere">Completing anywhere</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><th colspan="3" align="left" valign="top"><pre class="menu-comment">
Org-roam Protocol
</pre></th></tr><tr><td align="left" valign="top">&bull; <a href="#Installation-_00281_0029">Installation</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">&bull; <a href="#The-roam_002dnode-protocol">The roam-node protocol</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">&bull; <a href="#The-roam_002dref-protocol">The roam-ref protocol</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><th colspan="3" align="left" valign="top"><pre class="menu-comment">
Installation
</pre></th></tr><tr><td align="left" valign="top">&bull; <a href="#Linux">Linux</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">&bull; <a href="#Mac-OS">Mac OS</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">&bull; <a href="#Windows">Windows</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><th colspan="3" align="left" valign="top"><pre class="menu-comment">
The Templating System
</pre></th></tr><tr><td align="left" valign="top">&bull; <a href="#Template-Walkthrough">Template Walkthrough</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">&bull; <a href="#Org_002droam-Template-Expansion">Org-roam Template Expansion</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><th colspan="3" align="left" valign="top"><pre class="menu-comment">
Graphing
</pre></th></tr><tr><td align="left" valign="top">&bull; <a href="#Graph-Options">Graph Options</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><th colspan="3" align="left" valign="top"><pre class="menu-comment">
Org-roam Dailies
</pre></th></tr><tr><td align="left" valign="top">&bull; <a href="#Configuration">Configuration</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">&bull; <a href="#Usage">Usage</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><th colspan="3" align="left" valign="top"><pre class="menu-comment">
Performance Optimization
</pre></th></tr><tr><td align="left" valign="top">&bull; <a href="#Garbage-Collection">Garbage Collection</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><th colspan="3" align="left" valign="top"><pre class="menu-comment">
The Org-mode Ecosystem
</pre></th></tr><tr><td align="left" valign="top">&bull; <a href="#Browsing-History-with-winner_002dmode">Browsing History with winner-mode</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">&bull; <a href="#Versioning-Notes">Versioning Notes</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">&bull; <a href="#Full_002dtext-search-with-Deft">Full-text search with Deft</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">&bull; <a href="#Org_002djournal">Org-journal</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">&bull; <a href="#Org_002ddownload">Org-download</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">&bull; <a href="#mathpixel">mathpix.el</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">&bull; <a href="#Org_002dnoter-_002f-Interleave">Org-noter / Interleave</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">&bull; <a href="#Bibliography">Bibliography</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">&bull; <a href="#Spaced-Repetition">Spaced Repetition</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><th colspan="3" align="left" valign="top"><pre class="menu-comment">
FAQ
</pre></th></tr><tr><td align="left" valign="top">&bull; <a href="#How-do-I-have-more-than-one-Org_002droam-directory_003f">How do I have more than one Org-roam directory?</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">&bull; <a href="#How-do-I-migrate-from-Roam-Research_003f">How do I migrate from Roam Research?</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">&bull; <a href="#How-do-I-create-a-note-whose-title-already-matches-one-of-the-candidates_003f">How do I create a note whose title already matches one of the candidates?</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><th colspan="3" align="left" valign="top"><pre class="menu-comment">
Developer&rsquo;s Guide to Org-roam
</pre></th></tr><tr><td align="left" valign="top">&bull; <a href="#Org_002droam_0027s-Design-Principle">Org-roam's Design Principle</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">&bull; <a href="#Building-Extensions-and-Advanced-Customization-of-Org_002droam">Building Extensions and Advanced Customization of Org-roam</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><th colspan="3" align="left" valign="top"><pre class="menu-comment">
Building Extensions and Advanced Customization of Org-roam
</pre></th></tr><tr><td align="left" valign="top">&bull; <a href="#Accessing-the-Database">Accessing the Database</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">&bull; <a href="#Accessing-and-Modifying-Nodes">Accessing and Modifying Nodes</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">&bull; <a href="#Extending-the-Capture-System">Extending the Capture System</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><th colspan="3" align="left" valign="top"><pre class="menu-comment">
Appendix
</pre></th></tr><tr><td align="left" valign="top">&bull; <a href="#Note_002dtaking-Workflows">Note-taking Workflows</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">&bull; <a href="#Ecosystem">Ecosystem</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><th colspan="3" align="left" valign="top"><pre class="menu-comment">
</pre></th></tr></table>
<hr>
<span id="Introduction"></span><div class="header">
<p>
Next: <a href="#Target-Audience" accesskey="n" rel="next">Target Audience</a>, Previous: <a href="#Top" accesskey="p" rel="prev">Top</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> &nbsp; [<a href="#Keystroke-Index" title="Index" rel="index">Index</a>]</p>
</div>
<span id="Introduction-1"></span><h2 class="chapter">1 Introduction</h2>
<p>Org-roam is a tool for networked thought. It reproduces some of <a href="https://roamresearch.com/">Roam
Research&rsquo;s</a> <a id="DOCF1" href="#FOOT1"><sup>1</sup></a> key features within <a href="https://orgmode.org/">Org-mode</a>.
</p>
<p>Org-roam allows for effortless non-hierarchical note-taking: with Org-roam,
notes flow naturally, making note-taking fun and easy. Org-roam augments the
Org-mode syntax, and will work for anyone already using Org-mode for their
personal wiki.
</p>
<p>Org-roam leverages the mature ecosystem around Org-mode. For example, it has
first-class support for <a href="https://github.com/jkitchin/org-ref">org-ref</a> for citation management, and is able to
piggyback off Org&rsquo;s excellent LaTeX and source-block evaluation capabilities.
</p>
<p>Org-roam provides these benefits over other tooling:
</p>
<ul>
<li> <strong>Privacy and Security:</strong> Your personal wiki belongs only to you, entirely
offline and in your control. Encrypt your notes with GPG.
</li><li> <strong>Longevity of Plain Text:</strong> Unlike web solutions like Roam Research, the notes
are first and foremost plain Org-mode files &ndash; Org-roam simply builds an
auxiliary database to give the personal wiki superpowers. Having your notes
in plain-text is crucial for the longevity of your wiki. Never have to worry
about proprietary web solutions being taken down. The notes are still
functional even if Org-roam ceases to exist.
</li><li> <strong>Free and Open Source:</strong> Org-roam is free and open-source, which means that if
you feel unhappy with any part of Org-roam, you may choose to extend Org-roam,
or open a pull request.
</li><li> <strong>Leverage the Org-mode ecosystem:</strong> Over the decades, Emacs and Org-mode has
developed into a mature system for plain-text organization. Building upon
Org-mode already puts Org-roam light-years ahead of many other solutions.
</li><li> <strong>Built on Emacs:</strong> Emacs is also a fantastic interface for editing text, and
Org-roam inherits many of the powerful text-navigation and editing packages
available to Emacs.
</li></ul>
<hr>
<span id="Target-Audience"></span><div class="header">
<p>
Next: <a href="#A-Brief-Introduction-to-the-Zettelkasten-Method" accesskey="n" rel="next">A Brief Introduction to the Zettelkasten Method</a>, Previous: <a href="#Introduction" accesskey="p" rel="prev">Introduction</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> &nbsp; [<a href="#Keystroke-Index" title="Index" rel="index">Index</a>]</p>
</div>
<span id="Target-Audience-1"></span><h2 class="chapter">2 Target Audience</h2>
<p>Org-roam is a tool that will appear unfriendly to anyone unfamiliar with Emacs
and Org-mode, but it is also extremely powerful to those willing to put effort
inn mastering the intricacies. Org-roam stands on the shoulders of giants. Emacs
was first created in 1976, and remains the tool of choice for many for editing
text and designing textual interfaces. The malleability of Emacs allowed the
creation of Org-mode, an all-purpose plain-text system for maintaining TODO
lists, planning projects, and authoring documents. Both of these tools are
incredibly vast and require significant time investment to master.
</p>
<p>Org-roam assumes only basic familiarity with these tools. It is not difficult to
get up and running with basic text-editing functionality, but one will only
fully appreciate the power of building Roam functionality into Emacs and
Org-mode when the usage of these tools become more advanced.
</p>
<p>One key advantage to Org-roam is that building on top of Emacs gives it
malleability. This is especially important for note-taking workflows. It is our
belief that note-taking workflows are extremely personal, and there is no one
tool that&rsquo;s perfect for you. Org-mode and Org-roam allows you to discover what
works for you, and build that perfect tool for yourself.
</p>
<p>If you are new to the software, and choose to take this leap of faith, I hope
you find yourself equally entranced as Neal Stephenson was.
</p>
<blockquote>
<p>Emacs outshines all other editing software in approximately the same way that
the noonday sun does the stars. It is not just bigger and brighter; it simply
makes everything else vanish. Neal Stephenson, In the Beginning was the
Command Line (1998)
</p>
</blockquote>
<hr>
<span id="A-Brief-Introduction-to-the-Zettelkasten-Method"></span><div class="header">
<p>
Next: <a href="#Installation" accesskey="n" rel="next">Installation</a>, Previous: <a href="#Target-Audience" accesskey="p" rel="prev">Target Audience</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> &nbsp; [<a href="#Keystroke-Index" title="Index" rel="index">Index</a>]</p>
</div>
<span id="A-Brief-Introduction-to-the-Zettelkasten-Method-1"></span><h2 class="chapter">3 A Brief Introduction to the Zettelkasten Method</h2>
<p>Org-roam provides utilities for maintaining a digital slip-box. This section
aims to provide a brief introduction to the &ldquo;slip-box&rdquo;, or &ldquo;Zettelkasten&rdquo;
method. By providing some background on the method, we hope that the design
decisions of Org-roam will become clear, and that will aid in using Org-roam
appropriately. In this section we will introduce terms commonly used within the
Zettelkasten community and the Org-roam forums.
</p>
<p>The Zettelkasten is a personal tool for thinking and writing. It places heavy
emphasis on connecting ideas, building up a web of thought. Hence, it is well
suited for knowledge workers and intellectual tasks, such as conducting
research. The Zettelkasten can act as a research partner, where conversations
with it may produce new and surprising lines of thought.
</p>
<p>This method is attributed to German sociologist Niklas Luhmann, who using the
method had produced volumes of written works. Luhmann&rsquo;s slip-box was simply a
box of cards. These cards are small &ndash; often only large enough to fit a single
concept. The size limitation encourages ideas to be broken down into individual
concepts. These ideas are explicitly linked together. The breakdown of ideas
encourages tangential exploration of ideas, increasing the surface for thought.
Making linking explicit between notes also encourages one to think about the
connections between concepts.
</p>
<p>At the corner of each note, Luhmann ascribed each note with an ordered ID,
allowing him to link and jump between notes. In Org-roam, we simply use
hyperlinks.
</p>
<p>Org-roam is the slip-box, digitalized in Org-mode. Every zettel (card) is a
plain-text, Org-mode file. In the same way one would maintain a paper slip-box,
Org-roam makes it easy to create new zettels, pre-filling boilerplate content
using a powerful templating system.
</p>
<p><strong>Fleeting notes</strong>
</p>
<p>A slip-box requires a method for quickly capturing ideas. These are called
<strong>fleeting notes</strong>: they are simple reminders of information or ideas that will
need to be processed later on, or trashed. This is typically accomplished using
<code>org-capture</code> (see <a href="https://www.gnu.org/software/emacs/manual/html_mono/org.html#Capture">(org)Capture</a>), or using Org-roam&rsquo;s daily notes
functionality (see <a href="#Org_002droam-Dailies">Org-roam Dailies</a>). This provides a central inbox for collecting
thoughts, to be processed later into permanent notes.
</p>
<p><strong>Permanent notes</strong>
</p>
<p>Permanent notes are further split into two categories: <strong>literature notes</strong> and
<strong>concept notes</strong>. Literature notes can be brief annotations on a particular
source (e.g. book, website or paper), that you&rsquo;d like to access later on.
Concept notes require much more care in authoring: they need to be
self-explanatory and detailed. Org-roam&rsquo;s templating system supports the
addition of different templates to facilitate the creation of these notes.
</p>
<p>For further reading on the Zettelkasten method, &ldquo;How to Take Smart Notes&rdquo; by
Sonke Ahrens is a decent guide.
</p>
<hr>
<span id="Installation"></span><div class="header">
<p>
Next: <a href="#Getting-Started" accesskey="n" rel="next">Getting Started</a>, Previous: <a href="#A-Brief-Introduction-to-the-Zettelkasten-Method" accesskey="p" rel="prev">A Brief Introduction to the Zettelkasten Method</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> &nbsp; [<a href="#Keystroke-Index" title="Index" rel="index">Index</a>]</p>
</div>
<span id="Installation-1"></span><h2 class="chapter">4 Installation</h2>
<p>Org-roam can be installed using Emacs&rsquo; package manager or manually from its
development repository.
</p>
<table class="menu" border="0" cellspacing="0">
<tr><td align="left" valign="top">&bull; <a href="#Installing-from-MELPA" accesskey="1">Installing from MELPA</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">&bull; <a href="#Installing-from-Apt" accesskey="2">Installing from Apt</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">&bull; <a href="#Installing-from-Source" accesskey="3">Installing from Source</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">&bull; <a href="#Installation-Troubleshooting" accesskey="4">Installation Troubleshooting</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
</table>
<hr>
<span id="Installing-from-MELPA"></span><div class="header">
<p>
Next: <a href="#Installing-from-Apt" accesskey="n" rel="next">Installing from Apt</a>, Up: <a href="#Installation" accesskey="u" rel="up">Installation</a> &nbsp; [<a href="#Keystroke-Index" title="Index" rel="index">Index</a>]</p>
</div>
<span id="Installing-from-MELPA-1"></span><h3 class="section">4.1 Installing from MELPA</h3>
<p>Org-roam is available from Melpa and Melpa-Stable. If you haven&rsquo;t used Emacs&rsquo;
package manager before, you may familiarize yourself with it by reading the
documentation in the Emacs manual, see <a href="https://www.gnu.org/software/emacs/manual/html_mono/emacs.html#Packages">(emacs)Packages</a>. Then, add one of the
archives to &lsquo;<samp>package-archives</samp>&rsquo;:
</p>
<ul>
<li> To use Melpa:
</li></ul>
<div class="lisp">
<pre class="lisp">(require 'package)
(add-to-list 'package-archives
'(&quot;melpa&quot; . &quot;http://melpa.org/packages/&quot;) t)
</pre></div>
<ul>
<li> To use Melpa-Stable:
</li></ul>
<div class="lisp">
<pre class="lisp">(require 'package)
(add-to-list 'package-archives
'(&quot;melpa-stable&quot; . &quot;http://stable.melpa.org/packages/&quot;) t)
</pre></div>
<p>Org-roam also depends on a recent version of Org, which can be obtained in Org&rsquo;s
package repository (see <a href="https://www.gnu.org/software/emacs/manual/html_mono/org.html#Installation">(org)Installation</a>). To use Org&rsquo;s ELPA archive:
</p>
<div class="lisp">
<pre class="lisp">(add-to-list 'package-archives '(&quot;org&quot; . &quot;https://orgmode.org/elpa/&quot;) t)
</pre></div>
<p>Once you have added your preferred archive, you need to update the
local package list using:
</p>
<div class="example">
<pre class="example">M-x package-refresh-contents RET
</pre></div>
<p>Once you have done that, you can install Org-roam and its dependencies
using:
</p>
<div class="example">
<pre class="example">M-x package-install RET org-roam RET
</pre></div>
<hr>
<span id="Installing-from-Apt"></span><div class="header">
<p>
Next: <a href="#Installing-from-Source" accesskey="n" rel="next">Installing from Source</a>, Previous: <a href="#Installing-from-MELPA" accesskey="p" rel="prev">Installing from MELPA</a>, Up: <a href="#Installation" accesskey="u" rel="up">Installation</a> &nbsp; [<a href="#Keystroke-Index" title="Index" rel="index">Index</a>]</p>
</div>
<span id="Installing-from-Apt-1"></span><h3 class="section">4.2 Installing from Apt</h3>
<p>Users of Debian 11 or later or Ubuntu 20.10 or later can simply install Org-roam
using Apt:
</p>
<div class="example">
<pre class="example">apt-get install elpa-org-roam
</pre></div>
<p>Org-roam will then be autoloaded into Emacs.
</p>
<hr>
<span id="Installing-from-Source"></span><div class="header">
<p>
Next: <a href="#Installation-Troubleshooting" accesskey="n" rel="next">Installation Troubleshooting</a>, Previous: <a href="#Installing-from-Apt" accesskey="p" rel="prev">Installing from Apt</a>, Up: <a href="#Installation" accesskey="u" rel="up">Installation</a> &nbsp; [<a href="#Keystroke-Index" title="Index" rel="index">Index</a>]</p>
</div>
<span id="Installing-from-Source-1"></span><h3 class="section">4.3 Installing from Source</h3>
<p>You may install Org-roam directly from the repository on <a href="https://github.com/org-roam/org-roam">GitHub</a> if you like.
This will give you access to the latest version hours or days before it appears
on MELPA, and months (or more) before it is added to the Debian or Ubuntu
repositories. This will also give you access to various developmental branches
that may be available.
</p>
<p>Note, however, that development version, and especially any feature branches,
may not always be in working order. You&rsquo;ll need to be prepared to do some
debugging, or to manually roll-back to working versions, if you install from
GitHub.
</p>
<p>Installing from GitHub requires that you clone the repository:
</p>
<div class="example">
<pre class="example">git clone https://github.com/org-roam/org-roam.git /path/to/org/roam
</pre></div>
<p>where <code>./path/to/org/roam</code> is the location you will store your copy of the code.
</p>
<p>Next, you need to add this location to your load path, and <code>require</code> the
Org-roam library. Add the following code to your <code>.emacs</code>:
</p>
<div class="lisp">
<pre class="lisp">(add-to-list 'load-path &quot;/path/to/org/roam&quot;)
(require 'org-roam)
</pre></div>
<p>You now have Org-roam installed. However, you don&rsquo;t necessarily have the
dependencies that it requires. These include:
</p>
<ul>
<li> dash
</li><li> f
</li><li> s
</li><li> org
</li><li> emacsql
</li><li> emacsql-sqlite
</li></ul>
<p>You can install this manually as well, or get the latest version from MELPA. You
may wish to use <a href="https://github.com/jwiegley/use-package">use-package</a>, <a href="https://github.com/raxod502/straight.el">straight.el</a> to help manage this.
</p>
<p>If you would like to install the manual for access from Emacs&rsquo; built-in Info
system, you&rsquo;ll need to compile the .texi source file, and install it in an
appropriate location.
</p>
<p>To compile the .texi source file, from a terminal navigate to the <code>/doc</code>
subdirectory of the Org-roam repository, and run the following:
</p>
<div class="example">
<pre class="example">make infodir=/path/to/my/info/files install-info
</pre></div>
<p>Where <code>/path/to/my/info/files</code> is the location where you keep info files. This
target directory needs to be stored in the variable
&lsquo;Info-default-directory-list&lsquo;. If you aren&rsquo;t using one of the default info
locations, you can configure this with the following in your <code>.emacs</code> file:
</p>
<div class="lisp">
<pre class="lisp">(require 'info)
(add-to-list 'Info-default-directory-list
&quot;/path/to/my/info/files&quot;)
</pre></div>
<p>You can also use one of the default locations, such as:
</p>
<ul>
<li> <em>usr/local/share/info</em>
</li><li> <em>usr/share/info</em>
</li><li> <em>usr/local/share/info</em>
</li></ul>
<p>If you do this, you&rsquo;ll need to make sure you have write-access to that location,
or run the above <code>make</code> command as root.
</p>
<p>Now that the info file is ready, you need to add it to the corresponding <code>dir</code>
file:
</p>
<div class="example">
<pre class="example">install-info /path/to/my/info/files/org-roam.info /path/to/my/info/files/dir
</pre></div>
<hr>
<span id="Installation-Troubleshooting"></span><div class="header">
<p>
Previous: <a href="#Installing-from-Source" accesskey="p" rel="prev">Installing from Source</a>, Up: <a href="#Installation" accesskey="u" rel="up">Installation</a> &nbsp; [<a href="#Keystroke-Index" title="Index" rel="index">Index</a>]</p>
</div>
<span id="Installation-Troubleshooting-1"></span><h3 class="section">4.4 Installation Troubleshooting</h3>
<table class="menu" border="0" cellspacing="0">
<tr><td align="left" valign="top">&bull; <a href="#C-Compiler" accesskey="1">C Compiler</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
</table>
<hr>
<span id="C-Compiler"></span><div class="header">
<p>
Up: <a href="#Installation-Troubleshooting" accesskey="u" rel="up">Installation Troubleshooting</a> &nbsp; [<a href="#Keystroke-Index" title="Index" rel="index">Index</a>]</p>
</div>
<span id="C-Compiler-1"></span><h4 class="subsection">4.4.1 C Compiler</h4>
<p>Org-roam relies on an Emacs package called <code>emacsql</code> and <code>emacsql-sqlite</code> to
work with the <code>sqlite</code> database. Both of them should be installed automatically
in your Emacs environment as a prerequisite for Org-roam when you install it.
</p>
<p><code>emacsql-sqlite</code> requires a C compiler (e.g. <code>gcc</code> or <code>clang</code>) to be present in
your computer. How to install a C compiler depends on the OS that you use.
</p>
<ul>
<li> For Windows:
</li></ul>
<p>There are various ways to install one, depending on how you have installed
Emacs. If you use Emacs within a Cygwin or MinGW environment, then you should
install a compiler using their respective package manager.
</p>
<p>If you have installed your Emacs from the <a href="https://www.gnu.org/software/emacs/">GNU Emacs website</a>, then the easiest way
is to use <a href="https://www.msys2.org/">MSYS2</a> as at the time of this writing:
</p>
<ul>
<li> Use the installer in the official website and install MSYS2
</li><li> Run MSYS2
</li><li> In the command-line tool, type the following and answer &ldquo;Y&rdquo; to proceed:
<div class="example">
<pre class="example">pacman -S gcc
</pre></div>
<p>Note that you do not need to manually set the PATH for MSYS2; the
</p></li></ul>
<p>installer automatically takes care of it for you.
</p>
<ul>
<li> Open Emacs and call <code>M-x org-roam-setup</code>
<p>This will automatically start compiling <code>emacsql-sqlite</code>; you should see a
</p></li></ul>
<p>message in minibuffer. It may take a while until compilation completes. Once
complete, you should see a new file <code>emacsql-sqlite.exe</code> created in a subfolder
named <code>sqlite</code> under <code>emacsql-sqlite</code> installation folder. It&rsquo;s typically in
your Emacs configuration folder like this:
<code>/.config/emacs/elpa/emacsql-sqlite-20190727.1710/sqlite</code>
</p>
<hr>
<span id="Getting-Started"></span><div class="header">
<p>
Next: <a href="#The-Org_002droam-Buffer" accesskey="n" rel="next">The Org-roam Buffer</a>, Previous: <a href="#Installation" accesskey="p" rel="prev">Installation</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> &nbsp; [<a href="#Keystroke-Index" title="Index" rel="index">Index</a>]</p>
</div>
<span id="Getting-Started-1"></span><h2 class="chapter">5 Getting Started</h2>
<table class="menu" border="0" cellspacing="0">
<tr><td align="left" valign="top">&bull; <a href="#The-Org_002droam-Node" accesskey="1">The Org-roam Node</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">&bull; <a href="#Links-between-Nodes" accesskey="2">Links between Nodes</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">&bull; <a href="#Setting-up-Org_002droam" accesskey="3">Setting up Org-roam</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">&bull; <a href="#Customizing-Node-Caching" accesskey="4">Customizing Node Caching</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">&bull; <a href="#Creating-and-Linking-Nodes" accesskey="5">Creating and Linking Nodes</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
</table>
<hr>
<span id="The-Org_002droam-Node"></span><div class="header">
<p>
Next: <a href="#Links-between-Nodes" accesskey="n" rel="next">Links between Nodes</a>, Up: <a href="#Getting-Started" accesskey="u" rel="up">Getting Started</a> &nbsp; [<a href="#Keystroke-Index" title="Index" rel="index">Index</a>]</p>
</div>
<span id="The-Org_002droam-Node-1"></span><h3 class="section">5.1 The Org-roam Node</h3>
<p>We first begin with some terminology we&rsquo;ll use throughout the manual. We term
the basic denomination in Org-roam a node. We define a node as follows:
</p>
<blockquote>
<p>A node is any headline or top level file with an ID.
</p>
</blockquote>
<p>For example, with this example file content:
</p>
<div class="example">
<pre class="example">:PROPERTIES:
:ID: foo
:END:
#+title: Foo
* Bar
:PROPERTIES:
:ID: bar
:END:
</pre></div>
<p>We create two nodes:
</p>
<ul>
<li> A file node &ldquo;Foo&rdquo; with id <code>foo</code>.
</li><li> A headline node &ldquo;Bar&rdquo; with id <code>bar</code>.
</li></ul>
<p>Headlines without IDs will not be considered Org-roam nodes. Org IDs can be
added to files or headlines via the interactive command <code>M-x org-id-get-create</code>.
</p>
<hr>
<span id="Links-between-Nodes"></span><div class="header">
<p>
Next: <a href="#Setting-up-Org_002droam" accesskey="n" rel="next">Setting up Org-roam</a>, Previous: <a href="#The-Org_002droam-Node" accesskey="p" rel="prev">The Org-roam Node</a>, Up: <a href="#Getting-Started" accesskey="u" rel="up">Getting Started</a> &nbsp; [<a href="#Keystroke-Index" title="Index" rel="index">Index</a>]</p>
</div>
<span id="Links-between-Nodes-1"></span><h3 class="section">5.2 Links between Nodes</h3>
<p>We link between nodes using Org&rsquo;s standard ID link (e.g. <code>id:foo</code>). While only
ID links will be considered during the computation of links between nodes,
Org-roam caches all other links in the documents for external use.
</p>
<hr>
<span id="Setting-up-Org_002droam"></span><div class="header">
<p>
Next: <a href="#Customizing-Node-Caching" accesskey="n" rel="next">Customizing Node Caching</a>, Previous: <a href="#Links-between-Nodes" accesskey="p" rel="prev">Links between Nodes</a>, Up: <a href="#Getting-Started" accesskey="u" rel="up">Getting Started</a> &nbsp; [<a href="#Keystroke-Index" title="Index" rel="index">Index</a>]</p>
</div>
<span id="Setting-up-Org_002droam-1"></span><h3 class="section">5.3 Setting up Org-roam</h3>
<p>Org-roam&rsquo;s capabilities stem from its aggressive caching: it crawls all files
within <code>org-roam-directory</code>, and maintains a cache of all links and nodes.
</p>
<p>To start using Org-roam, pick a location to store the Org-roam files. The
directory that will contain your notes is specified by the variable
<code>org-roam-directory</code>. Org-roam searches recursively within <code>org-roam-directory</code>
for notes. This variable needs to be set before any calls to Org-roam functions.
</p>
<p>For this tutorial, create an empty directory, and set <code>org-roam-directory</code>:
</p>
<div class="lisp">
<pre class="lisp">(make-directory &quot;~/org-roam&quot;)
(setq org-roam-directory (file-truename &quot;~/org-roam&quot;))
</pre></div>
<p>The <code>file-truename</code> function is only necessary when you use symbolic links
inside <code>org-roam-directory</code>: Org-roam does not resolve symbolic links.
</p>
<p>Next, we setup Org-roam to run functions on file changes to maintain cache
consistency. This is achieved by running <code>M-x org-roam-setup</code>. To ensure that
Org-roam is available on startup, place this in your Emacs configuration:
</p>
<div class="lisp">
<pre class="lisp">(require 'org-roam)
(org-roam-setup)
</pre></div>
<p>To build the cache manually, run <code>M-x org-roam-db-build-cache</code>. Cache builds may
take a while the first time, but subsequent builds are often instantaneous
because they only reprocess modified files.
</p>
<hr>
<span id="Customizing-Node-Caching"></span><div class="header">
<p>
Next: <a href="#Creating-and-Linking-Nodes" accesskey="n" rel="next">Creating and Linking Nodes</a>, Previous: <a href="#Setting-up-Org_002droam" accesskey="p" rel="prev">Setting up Org-roam</a>, Up: <a href="#Getting-Started" accesskey="u" rel="up">Getting Started</a> &nbsp; [<a href="#Keystroke-Index" title="Index" rel="index">Index</a>]</p>
</div>
<span id="Customizing-Node-Caching-1"></span><h3 class="section">5.4 Customizing Node Caching</h3>
<p>By default, all nodes (any headline or file with an ID) are cached by Org-roam.
There are instances where you may want to have headlines with ID, but not have
them cached by Org-roam.
</p>
<p>To exclude a headline from the Org-roam database, set the <code>ROAM_EXCLUDE</code>
property to a non-nil value. For example:
</p>
<div class="example">
<pre class="example">* Foo
:PROPERTIES:
:ID: foo
:ROAM_EXCLUDE: t
:END:
</pre></div>
<p>One can also set <code>org-roam-db-node-include-function</code>. For example, to exclude
all headlines with the <code>ATTACH</code> tag from the Org-roam database, one can set:
</p>
<div class="example">
<pre class="example">(setq org-roam-db-node-include-function
(lambda ()
(not (member &quot;ATTACH&quot; (org-get-tags)))))
</pre></div>
<hr>
<span id="Creating-and-Linking-Nodes"></span><div class="header">
<p>
Previous: <a href="#Customizing-Node-Caching" accesskey="p" rel="prev">Customizing Node Caching</a>, Up: <a href="#Getting-Started" accesskey="u" rel="up">Getting Started</a> &nbsp; [<a href="#Keystroke-Index" title="Index" rel="index">Index</a>]</p>
</div>
<span id="TODO-Creating-and-Linking-Nodes"></span><h3 class="section">5.5 <strong>TODO</strong> Creating and Linking Nodes</h3>
<p>Org-roam makes it easy to create notes and link them together. There are 2 main
functions for creating nodes:
</p>
<ul>
<li> <code>org-roam-node-insert</code>: creates a node if it does not exist, and inserts a
link to the node at point.
</li><li> <code>org-roam-node-find</code>: creates a node if it does not exist, and visits the
node.
</li><li> <code>org-roam-capture</code>: creates a node if it does not exist, and restores the
current window configuration upon completion.
</li></ul>
<p>Let&rsquo;s first try <code>org-roam-node-find</code>. Calling <code>M-x org-roam-node-find</code> will
show a list of titles for nodes that reside in <code>org-roam-directory</code>. It should
show nothing right now, since there are no notes in the directory. Enter the
title of the note you wish to create, and press <code>RET</code>. This begins the note
creation process. This process uses <code>org-capture</code>&rsquo;s templating system, and can
be customized (see <a href="#The-Templating-System">The Templating System</a>). Using the default template, pressing
<code>C-c C-c</code> finishes the note capture.
</p>
<p>Now that we have a node, we can try inserting a link to the node using <code>M-x
org-roam-node-insert</code>. This brings up the list of nodes, which should contain
the node you just created. Selecting the node will insert an <code>id:</code> link to the
node. If you instead entered a title that does not exist, you will once again be
brought through the node creation process.
</p>
<p>One can also conveniently insert links via the completion-at-point functions
Org-roam provides (see <a href="#Completion">Completion</a>).
</p>
<hr>
<span id="The-Org_002droam-Buffer"></span><div class="header">
<p>
Next: <a href="#Node-Properties" accesskey="n" rel="next">Node Properties</a>, Previous: <a href="#Getting-Started" accesskey="p" rel="prev">Getting Started</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> &nbsp; [<a href="#Keystroke-Index" title="Index" rel="index">Index</a>]</p>
</div>
<span id="The-Org_002droam-Buffer-1"></span><h2 class="chapter">6 The Org-roam Buffer</h2>
<p>Org-roam provides the Org-roam buffer: an interface to view relationships with
other notes (backlinks, reference links, unlinked references etc.). There are
two main functions to use here:
</p>
<ul>
<li> <code>org-roam-buffer</code>: Launch an Org-roam buffer for the current node at point.
</li><li> <code>org-roam-buffer-toggle</code>: Launch an Org-roam buffer that tracks the node
currently at point. This means that the content of the buffer changes as the
point is moved, if necessary.
</li></ul>
<p>Use <code>org-roam-buffer-toggle</code> when you want wish for the Org-roam buffer to
buffer, call <code>M-x org-roam-buffer</code>.
</p>
<dl>
<dt id="index-org_002droam_002dbuffer">Function: <strong>org-roam-buffer</strong></dt>
<dd>
<p>Launch an Org-roam buffer for the current node at point.
</p></dd></dl>
<p>To bring up a buffer that tracks the current node at point, call <code>M-x
org-roam-buffer-toggle</code>.
</p>
<dl>
<dt id="index-org_002droam_002dbuffer_002dtoggle">Function: <strong>org-roam-buffer-toggle</strong></dt>
<dd>
<p>Toggle display of the <code>org-roam-buffer</code>.
</p></dd></dl>
<table class="menu" border="0" cellspacing="0">
<tr><td align="left" valign="top">&bull; <a href="#Navigating-the-Org_002droam-Buffer" accesskey="1">Navigating the Org-roam Buffer</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">&bull; <a href="#Configuring-what-is-displayed-in-the-buffer" accesskey="2">Configuring what is displayed in the buffer</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">&bull; <a href="#Configuring-the-Org_002droam-buffer-display" accesskey="3">Configuring the Org-roam buffer display</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">&bull; <a href="#Styling-the-Org_002droam-buffer" accesskey="4">Styling the Org-roam buffer</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
</table>
<hr>
<span id="Navigating-the-Org_002droam-Buffer"></span><div class="header">
<p>
Next: <a href="#Configuring-what-is-displayed-in-the-buffer" accesskey="n" rel="next">Configuring what is displayed in the buffer</a>, Up: <a href="#The-Org_002droam-Buffer" accesskey="u" rel="up">The Org-roam Buffer</a> &nbsp; [<a href="#Keystroke-Index" title="Index" rel="index">Index</a>]</p>
</div>
<span id="Navigating-the-Org_002droam-Buffer-1"></span><h3 class="section">6.1 Navigating the Org-roam Buffer</h3>
<p>The Org-roam buffer uses <code>magit-section</code>, making the typical <code>magit-section</code>
keybindings available. Here are several of the more useful ones:
</p>
<ul>
<li> <code>M-{N}</code>: <code>magit-section-show-level-{N}-all</code>
</li><li> <code>n</code>: <code>magit-section-forward</code>
</li></ul>
<p>-<code>&lt;TAB&gt;</code>: <code>magit-section-toggle</code>
</p><ul>
<li> <code>&lt;RET&gt;</code>: <code>org-roam-visit-thing</code>
</li></ul>
<p><code>org-roam-visit-thing</code> is a placeholder command, that is replaced by
section-specific commands such as <code>org-roam-node-visit</code>.
</p>
<hr>
<span id="Configuring-what-is-displayed-in-the-buffer"></span><div class="header">
<p>
Next: <a href="#Configuring-the-Org_002droam-buffer-display" accesskey="n" rel="next">Configuring the Org-roam buffer display</a>, Previous: <a href="#Navigating-the-Org_002droam-Buffer" accesskey="p" rel="prev">Navigating the Org-roam Buffer</a>, Up: <a href="#The-Org_002droam-Buffer" accesskey="u" rel="up">The Org-roam Buffer</a> &nbsp; [<a href="#Keystroke-Index" title="Index" rel="index">Index</a>]</p>
</div>
<span id="Configuring-what-is-displayed-in-the-buffer-1"></span><h3 class="section">6.2 Configuring what is displayed in the buffer</h3>
<p>There are currently 3 provided widget types:
</p>
<ul>
<li> BacklinksView (preview of) nodes that link to this node
</li><li> Reference LinksNodes that reference this node (see <a href="#Refs">Refs</a>)
</li><li> Unlinked referencesView nodes that contain text that match the nodes
title/alias but are not linked
</li></ul>
<p>To configure what sections are displayed in the buffer, set <code>org-roam-mode-sections</code>.
</p>
<div class="lisp">
<pre class="lisp">(setq org-roam-mode-sections
(list #'org-roam-backlinks-section
#'org-roam-reflinks-section
;; #'org-roam-unlinked-references-section
))
</pre></div>
<p>Note that computing unlinked references may be slow, and has not been added in by default.
</p>
<hr>
<span id="Configuring-the-Org_002droam-buffer-display"></span><div class="header">
<p>
Next: <a href="#Styling-the-Org_002droam-buffer" accesskey="n" rel="next">Styling the Org-roam buffer</a>, Previous: <a href="#Configuring-what-is-displayed-in-the-buffer" accesskey="p" rel="prev">Configuring what is displayed in the buffer</a>, Up: <a href="#The-Org_002droam-Buffer" accesskey="u" rel="up">The Org-roam Buffer</a> &nbsp; [<a href="#Keystroke-Index" title="Index" rel="index">Index</a>]</p>
</div>
<span id="Configuring-the-Org_002droam-buffer-display-1"></span><h3 class="section">6.3 Configuring the Org-roam buffer display</h3>
<p>Org-roam does not control how the pop-up buffer is displayed: this is left to
the user. The author&rsquo;s recommended configuration is as follows:
</p>
<div class="lisp">
<pre class="lisp">(add-to-list 'display-buffer-alist
'((&quot;\\*org-roam\\*&quot;
(display-buffer-in-direction)
(direction . right)
(window-width . 0.33)
(window-height . fit-window-to-buffer))))
</pre></div>
<p>Crucially, the window is a regular window (not a side-window), and this allows
for predictable navigation:
</p>
<ul>
<li> <code>RET</code> navigates to thing-at-point in the current window, replacing the
Org-roam buffer.
</li><li> <code>C-u RET</code> navigates to thing-at-point in the other window.
</li></ul>
<hr>
<span id="Styling-the-Org_002droam-buffer"></span><div class="header">
<p>
Previous: <a href="#Configuring-the-Org_002droam-buffer-display" accesskey="p" rel="prev">Configuring the Org-roam buffer display</a>, Up: <a href="#The-Org_002droam-Buffer" accesskey="u" rel="up">The Org-roam Buffer</a> &nbsp; [<a href="#Keystroke-Index" title="Index" rel="index">Index</a>]</p>
</div>
<span id="TODO-Styling-the-Org_002droam-buffer"></span><h3 class="section">6.4 <strong>TODO</strong> Styling the Org-roam buffer</h3>
<hr>
<span id="Node-Properties"></span><div class="header">
<p>
Next: <a href="#Completion" accesskey="n" rel="next">Completion</a>, Previous: <a href="#The-Org_002droam-Buffer" accesskey="p" rel="prev">The Org-roam Buffer</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> &nbsp; [<a href="#Keystroke-Index" title="Index" rel="index">Index</a>]</p>
</div>
<span id="Node-Properties-1"></span><h2 class="chapter">7 Node Properties</h2>
<table class="menu" border="0" cellspacing="0">
<tr><td align="left" valign="top">&bull; <a href="#Standard-Org-properties" accesskey="1">Standard Org properties</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">&bull; <a href="#Titles-and-Aliases" accesskey="2">Titles and Aliases</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">&bull; <a href="#Tags" accesskey="3">Tags</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">&bull; <a href="#Refs" accesskey="4">Refs</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
</table>
<hr>
<span id="Standard-Org-properties"></span><div class="header">
<p>
Next: <a href="#Titles-and-Aliases" accesskey="n" rel="next">Titles and Aliases</a>, Up: <a href="#Node-Properties" accesskey="u" rel="up">Node Properties</a> &nbsp; [<a href="#Keystroke-Index" title="Index" rel="index">Index</a>]</p>
</div>
<span id="Standard-Org-properties-1"></span><h3 class="section">7.1 Standard Org properties</h3>
<p>Org-roam caches most of the standard Org properties. The full list now includes:
</p>
<ul>
<li> outline level
</li><li> todo state
</li><li> priority
</li><li> scheduled
</li><li> deadline
</li><li> tags
</li></ul>
<hr>
<span id="Titles-and-Aliases"></span><div class="header">
<p>
Next: <a href="#Tags" accesskey="n" rel="next">Tags</a>, Previous: <a href="#Standard-Org-properties" accesskey="p" rel="prev">Standard Org properties</a>, Up: <a href="#Node-Properties" accesskey="u" rel="up">Node Properties</a> &nbsp; [<a href="#Keystroke-Index" title="Index" rel="index">Index</a>]</p>
</div>
<span id="Titles-and-Aliases-1"></span><h3 class="section">7.2 Titles and Aliases</h3>
<p>Each node has a single title. For file nodes, this is specified with the
&lsquo;#+title&lsquo; property for the file. For headline nodes, this is the main text.
</p>
<p>Nodes can also have multiple aliases. Aliases allow searching for nodes via an
alternative name. For example, one may want to assign a well-known acronym (AI)
to a node titled &ldquo;Artificial Intelligence&rdquo;.
</p>
<p>To assign an alias to a node, add the &ldquo;ROAM<em>_ALIASES</em>&rdquo; property to the node:
</p>
<div class="example">
<pre class="example">* Artificial Intelligence
:PROPERTIES:
:ROAM_ALIASES: AI
:END:
</pre></div>
<p>Alternatively, Org-roam provides some functions to add or remove aliases.
</p>
<dl>
<dt id="index-org_002droam_002dalias_002dadd">Function: <strong>org-roam-alias-add</strong> <em>alias</em></dt>
<dd>
<p>Add ALIAS to the node at point. When called interactively, prompt for the
alias to add.
</p></dd></dl>
<dl>
<dt id="index-org_002droam_002dalias_002dremove">Function: <strong>org-roam-alias-remove</strong></dt>
<dd>
<p>Remove an alias from the node at point.
</p></dd></dl>
<hr>
<span id="Tags"></span><div class="header">
<p>
Next: <a href="#Refs" accesskey="n" rel="next">Refs</a>, Previous: <a href="#Titles-and-Aliases" accesskey="p" rel="prev">Titles and Aliases</a>, Up: <a href="#Node-Properties" accesskey="u" rel="up">Node Properties</a> &nbsp; [<a href="#Keystroke-Index" title="Index" rel="index">Index</a>]</p>
</div>
<span id="Tags-1"></span><h3 class="section">7.3 Tags</h3>
<p>Tags for top-level (file) nodes are pulled from the variable <code>org-file-tags</code>,
which is set by the <code>#+filetags</code> keyword, as well as other tags the file may
have inherited. Tags for headline level nodes are regular Org tags.
</p>
<p>Note that the <code>#+filetags</code> keyword results in tags being inherited by headers
within the file. This makes it impossible for selective tag inheritance: i.e.
either tag inheritance is turned off, or all headline nodes will inherit the
tags from the file node. This is a design compromise of Org-roam.
</p>
<hr>
<span id="Refs"></span><div class="header">
<p>
Previous: <a href="#Tags" accesskey="p" rel="prev">Tags</a>, Up: <a href="#Node-Properties" accesskey="u" rel="up">Node Properties</a> &nbsp; [<a href="#Keystroke-Index" title="Index" rel="index">Index</a>]</p>
</div>
<span id="Refs-1"></span><h3 class="section">7.4 Refs</h3>
<p>Refs are unique identifiers for nodes. These keys allow references to the key to
show up in the Org-roam buffer. For example, a node for a website may use the URL
as the ref, and a node for a paper may use an Org-ref citation key.
</p>
<p>To add a ref, add to the &ldquo;ROAM<em>_REFS</em>&rdquo; property as follows:
</p>
<div class="example">
<pre class="example">* Google
:PROPERTIES:
:ROAM_REFS: https://www.google.com/
:END:
</pre></div>
<p>With the above example, if another node links to <a href="https://www.google.com/">https://www.google.com/</a>, it
will show up as a “reference backlink”.
</p>
<p>These keys also come in useful for when taking website notes, using the
<code>roam-ref</code> protocol (see <a href="#Org_002droam-Protocol">Roam Protocol</a>).
</p>
<p>You may assign multiple refs to a single node, for example when you want
multiple papers in a series to share the same note, or an article has a citation
key and a URL at the same time.
</p>
<p>Org-roam also provides some functions to add or remove refs.
</p>
<dl>
<dt id="index-org_002droam_002dref_002dadd">Function: <strong>org-roam-ref-add</strong> <em>ref</em></dt>
<dd>
<p>Add REF to the node at point. When called interactively, prompt for the
ref to add.
</p></dd></dl>
<dl>
<dt id="index-org_002droam_002dref_002dremove">Function: <strong>org-roam-ref-remove</strong></dt>
<dd>
<p>Remove a ref from the node at point.
</p></dd></dl>
<hr>
<span id="Completion"></span><div class="header">
<p>
Next: <a href="#Encryption" accesskey="n" rel="next">Encryption</a>, Previous: <a href="#Node-Properties" accesskey="p" rel="prev">Node Properties</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> &nbsp; [<a href="#Keystroke-Index" title="Index" rel="index">Index</a>]</p>
</div>
<span id="Completion-1"></span><h2 class="chapter">8 Completion</h2>
<p>Completions for Org-roam are provided via <code>completion-at-point</code>. Org-roam
currently provides completions in two scenarios:
</p>
<ul>
<li> When within an Org bracket link
</li><li> Anywhere
</li></ul>
<p>Completions are installed locally in all Org-roam files. To trigger completions,
call <code>M-x completion-at-point</code>. If using <code>company-mode</code>, add <code>company-capf</code> to
<code>company-backends</code>.
</p>
<p>Completions respect <code>completion-styles</code>: the user is free to choose how
candidates are matched. An example of a completion style that has grown in
popularity is <a href="https://github.com/oantolin/orderless">orderless</a>.
</p>
<table class="menu" border="0" cellspacing="0">
<tr><td align="left" valign="top">&bull; <a href="#Completing-within-Link-Brackets" accesskey="1">Completing within Link Brackets</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">&bull; <a href="#Completing-anywhere" accesskey="2">Completing anywhere</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
</table>
<hr>
<span id="Completing-within-Link-Brackets"></span><div class="header">
<p>
Next: <a href="#Completing-anywhere" accesskey="n" rel="next">Completing anywhere</a>, Up: <a href="#Completion" accesskey="u" rel="up">Completion</a> &nbsp; [<a href="#Keystroke-Index" title="Index" rel="index">Index</a>]</p>
</div>
<span id="Completing-within-Link-Brackets-1"></span><h3 class="section">8.1 Completing within Link Brackets</h3>
<p>Completions within link brackets are provided by
<code>org-roam-complete-link-at-point</code>.
</p>
<p>The completion candidates are the titles and aliases for all Org-roam nodes.
Upon choosing a candidate, a <code>roam:Title</code> link will be inserted, linking to node
of choice.
</p>
<hr>
<span id="Completing-anywhere"></span><div class="header">
<p>
Previous: <a href="#Completing-within-Link-Brackets" accesskey="p" rel="prev">Completing within Link Brackets</a>, Up: <a href="#Completion" accesskey="u" rel="up">Completion</a> &nbsp; [<a href="#Keystroke-Index" title="Index" rel="index">Index</a>]</p>
</div>
<span id="Completing-anywhere-1"></span><h3 class="section">8.2 Completing anywhere</h3>
<p>The same completions can be triggered anywhere for the symbol at point if not
within a bracketed link. This is provided by <code>org-roam-complete-everywhere</code>.
Similarly, the completion candidates are the titles and aliases for all Org-roam
nodes, and upon choosing a candidate a <code>roam:Title</code> link will be inserted
linking to the node of choice.
</p>
<p>This is disable by default. To enable it, set <code>org-roam-completion-everywhere</code>
to <code>t</code>:
</p>
<div class="lisp">
<pre class="lisp">(setq org-roam-completion-everywhere t)
</pre></div>
<dl>
<dt id="index-org_002droam_002dcompletion_002deverywhere">Variable: <strong>org-roam-completion-everywhere</strong></dt>
</dl>
<p>When non-nil, provide link completion matching outside of Org links.
</p>
<hr>
<span id="Encryption"></span><div class="header">
<p>
Next: <a href="#Org_002droam-Protocol" accesskey="n" rel="next">Org-roam Protocol</a>, Previous: <a href="#Completion" accesskey="p" rel="prev">Completion</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> &nbsp; [<a href="#Keystroke-Index" title="Index" rel="index">Index</a>]</p>
</div>
<span id="Encryption-1"></span><h2 class="chapter">9 Encryption</h2>
<p>Emacs has support for creating and editing encrypted gpg files, and Org-roam need
not provide additional tooling. To create encrypted files, simply add the <code>.gpg</code>
extension in your Org-roam capture templates. For example:
</p>
<div class="lisp">
<pre class="lisp">(setq org-roam-capture-templates '((&quot;d&quot; &quot;default&quot; plain &quot;%?&quot;
:if-new (file+head &quot;${slug}.org.gpg&quot;
&quot;#+title: ${title}\n&quot;)
:unnarrowed t)))
</pre></div>
<hr>
<span id="Org_002droam-Protocol"></span><div class="header">
<p>
Next: <a href="#The-Templating-System" accesskey="n" rel="next">The Templating System</a>, Previous: <a href="#Encryption" accesskey="p" rel="prev">Encryption</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> &nbsp; [<a href="#Keystroke-Index" title="Index" rel="index">Index</a>]</p>
</div>
<span id="Org_002droam-Protocol-1"></span><h2 class="chapter">10 Org-roam Protocol</h2>
<p>Org-roam provides extensions for capturing content from external applications
such as the browser, via <code>org-protocol</code>. Org-roam extends <code>org-protocol</code> with 2
protocols: the <code>roam-node</code> and <code>roam-ref</code> protocols.
</p>
<table class="menu" border="0" cellspacing="0">
<tr><td align="left" valign="top">&bull; <a href="#Installation-_00281_0029" accesskey="1">Installation</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">&bull; <a href="#The-roam_002dnode-protocol" accesskey="2">The roam-node protocol</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">&bull; <a href="#The-roam_002dref-protocol" accesskey="3">The roam-ref protocol</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
</table>
<hr>
<span id="Installation-_00281_0029"></span><div class="header">
<p>
Next: <a href="#The-roam_002dnode-protocol" accesskey="n" rel="next">The roam-node protocol</a>, Up: <a href="#Org_002droam-Protocol" accesskey="u" rel="up">Org-roam Protocol</a> &nbsp; [<a href="#Keystroke-Index" title="Index" rel="index">Index</a>]</p>
</div>
<span id="Installation-2"></span><h3 class="section">10.1 Installation</h3>
<p>To enable Org-roam&rsquo;s protocol extensions, simply add the following to your init
file:
</p>
<div class="lisp">
<pre class="lisp">(require 'org-roam-protocol)
</pre></div>
<p>We also need to set up <code>org-protocol</code>: the instructions for setting up
<code>org-protocol</code> are reproduced below.
</p>
<table class="menu" border="0" cellspacing="0">
<tr><td align="left" valign="top">&bull; <a href="#Linux" accesskey="1">Linux</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">&bull; <a href="#Mac-OS" accesskey="2">Mac OS</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">&bull; <a href="#Windows" accesskey="3">Windows</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
</table>
<hr>
<span id="Linux"></span><div class="header">
<p>
Next: <a href="#Mac-OS" accesskey="n" rel="next">Mac OS</a>, Up: <a href="#Installation-_00281_0029" accesskey="u" rel="up">Installation (1)</a> &nbsp; [<a href="#Keystroke-Index" title="Index" rel="index">Index</a>]</p>
</div>
<span id="Linux-1"></span><h4 class="subsection">10.1.1 Linux</h4>
<p>For Linux users, create a desktop application in
<code>~/.local/share/applications/org-protocol.desktop</code>:
</p>
<div class="example">
<pre class="example">[Desktop Entry]
Name=Org-Protocol
Exec=emacsclient %u
Icon=emacs-icon
Type=Application
Terminal=false
MimeType=x-scheme-handler/org-protocol
</pre></div>
<p>Associate <code>org-protocol://</code> links with the desktop application by
running in your shell:
</p>
<div class="example">
<pre class="example">xdg-mime default org-protocol.desktop x-scheme-handler/org-protocol
</pre></div>
<p>To disable the &ldquo;confirm&rdquo; prompt in Chrome, you can also make Chrome show a
checkbox to tick, so that the <code>Org-Protocol Client</code> app will be used without
confirmation. To do this, run in a shell:
</p>
<div class="example">
<pre class="example">sudo mkdir -p /etc/opt/chrome/policies/managed/
sudo tee /etc/opt/chrome/policies/managed/external_protocol_dialog.json &gt;/dev/null &lt;&lt;'EOF'
{
&quot;ExternalProtocolDialogShowAlwaysOpenCheckbox&quot;: true
}
EOF
sudo chmod 644 /etc/opt/chrome/policies/managed/external_protocol_dialog.json
</pre></div>
<p>and then restart Chrome (for example, by navigating to &lt;chrome://restart&gt;) to
make the new policy take effect.
</p>
<p>See <a href="https://www.chromium.org/administrators/linux-quick-start">here</a> for more info on the <code>/etc/opt/chrome/policies/managed</code> directory and
<a href="https://cloud.google.com/docs/chrome-enterprise/policies/?policy=ExternalProtocolDialogShowAlwaysOpenCheckbox">here</a> for information on the <code>ExternalProtocolDialogShowAlwaysOpenCheckbox</code> policy.
</p>
<hr>
<span id="Mac-OS"></span><div class="header">
<p>
Next: <a href="#Windows" accesskey="n" rel="next">Windows</a>, Previous: <a href="#Linux" accesskey="p" rel="prev">Linux</a>, Up: <a href="#Installation-_00281_0029" accesskey="u" rel="up">Installation (1)</a> &nbsp; [<a href="#Keystroke-Index" title="Index" rel="index">Index</a>]</p>
</div>
<span id="Mac-OS-1"></span><h4 class="subsection">10.1.2 Mac OS</h4>
<p>For Mac OS, we need to create our own application.
</p>
<ul>
<li> Launch Script Editor
</li><li> Use the following script, paying attention to the path to <code>emacsclient</code>:
</li></ul>
<div class="lisp">
<pre class="lisp">on open location this_URL
set EC to &quot;/usr/local/bin/emacsclient --no-wait &quot;
set filePath to quoted form of this_URL
do shell script EC &amp; filePath
tell application &quot;Emacs&quot; to activate
end open location
</pre></div>
<ul>
<li> Save the script in <code>/Applications/OrgProtocolClient.app</code>, changing the script type to
&ldquo;Application&rdquo;, rather than &ldquo;Script&rdquo;.
</li><li> Edit <code>/Applications/OrgProtocolClient.app/Contents/Info.plist</code>, adding the
following before the last <code>&lt;/dict&gt;</code> tag:
</li></ul>
<div class="example">
<pre class="example">&lt;key&gt;CFBundleURLTypes&lt;/key&gt;
&lt;array&gt;
&lt;dict&gt;
&lt;key&gt;CFBundleURLName&lt;/key&gt;
&lt;string&gt;org-protocol handler&lt;/string&gt;
&lt;key&gt;CFBundleURLSchemes&lt;/key&gt;
&lt;array&gt;
&lt;string&gt;org-protocol&lt;/string&gt;
&lt;/array&gt;
&lt;/dict&gt;
&lt;/array&gt;
</pre></div>
<ul>
<li> Save the file, and run the <code>OrgProtocolClient.app</code> to register the protocol.
</li></ul>
<p>To disable the &ldquo;confirm&rdquo; prompt in Chrome, you can also make Chrome
show a checkbox to tick, so that the <code>OrgProtocol</code> app will be used
without confirmation. To do this, run in a shell:
</p>
<div class="example">
<pre class="example">defaults write com.google.Chrome ExternalProtocolDialogShowAlwaysOpenCheckbox -bool true
</pre></div>
<p>If you&rsquo;re using <a href="https://github.com/railwaycat/homebrew-emacsmacport">Emacs Mac Port</a>, it registered its &lsquo;Emacs.app&lsquo; as the default
handler for the URL scheme &lsquo;org-protocol&lsquo;. To make <code>OrgProtocol.app</code>
the default handler instead, run:
</p>
<div class="example">
<pre class="example">defaults write com.apple.LaunchServices/com.apple.launchservices.secure LSHandlers -array-add \
'{&quot;LSHandlerPreferredVersions&quot; = { &quot;LSHandlerRoleAll&quot; = &quot;-&quot;; }; LSHandlerRoleAll = &quot;org.yourusername.OrgProtocol&quot;; LSHandlerURLScheme = &quot;org-protocol&quot;;}'
</pre></div>
<p>Then restart your computer.
</p>
<hr>
<span id="Windows"></span><div class="header">
<p>
Previous: <a href="#Mac-OS" accesskey="p" rel="prev">Mac OS</a>, Up: <a href="#Installation-_00281_0029" accesskey="u" rel="up">Installation (1)</a> &nbsp; [<a href="#Keystroke-Index" title="Index" rel="index">Index</a>]</p>
</div>
<span id="Windows-1"></span><h4 class="subsection">10.1.3 Windows</h4>
<p>For Windows, create a temporary <code>org-protocol.reg</code> file:
</p>
<div class="example">
<pre class="example">REGEDIT4
[HKEY_CLASSES_ROOT\org-protocol]
@=&quot;URL:Org Protocol&quot;
&quot;URL Protocol&quot;=&quot;&quot;
[HKEY_CLASSES_ROOT\org-protocol\shell]
[HKEY_CLASSES_ROOT\org-protocol\shell\open]
[HKEY_CLASSES_ROOT\org-protocol\shell\open\command]
@=&quot;\&quot;C:\\Windows\\System32\\wsl.exe\&quot; emacsclient \&quot;%1\&quot;&quot;
</pre></div>
<p>The above will forward the protocol to WSL. If you run Emacs natively on
Windows, replace the last line with:
</p>
<div class="example">
<pre class="example">@=&quot;\&quot;c:\\path\\to\\emacs\\bin\\emacsclientw.exe\&quot; \&quot;%1\&quot;&quot;
</pre></div>
<p>After executing the .reg file, the protocol is registered and you can delete the
file.
</p>
<hr>
<span id="The-roam_002dnode-protocol"></span><div class="header">
<p>
Next: <a href="#The-roam_002dref-protocol" accesskey="n" rel="next">The roam-ref protocol</a>, Previous: <a href="#Installation-_00281_0029" accesskey="p" rel="prev">Installation (1)</a>, Up: <a href="#Org_002droam-Protocol" accesskey="u" rel="up">Org-roam Protocol</a> &nbsp; [<a href="#Keystroke-Index" title="Index" rel="index">Index</a>]</p>
</div>
<span id="The-roam_002dnode-protocol-1"></span><h3 class="section">10.2 The roam-node protocol</h3>
<p>The roam-node protocol opens the node with ID specified by the <code>node</code> key (e.g.
<code>org-protocol://roam-node?node=node-id</code>). <code>org-roam-graph</code> uses this to make the
graph navigable.
</p>
<hr>
<span id="The-roam_002dref-protocol"></span><div class="header">
<p>
Previous: <a href="#The-roam_002dnode-protocol" accesskey="p" rel="prev">The roam-node protocol</a>, Up: <a href="#Org_002droam-Protocol" accesskey="u" rel="up">Org-roam Protocol</a> &nbsp; [<a href="#Keystroke-Index" title="Index" rel="index">Index</a>]</p>
</div>
<span id="The-roam_002dref-protocol-1"></span><h3 class="section">10.3 The roam-ref protocol</h3>
<p>This protocol finds or creates a new note with a given <code>roam_key</code>:
</p>
<img src="images/roam-ref.gif" alt="images/roam-ref">
<p>To use this, create the following <a href="https://en.wikipedia.org/wiki/Bookmarklet">bookmarklet</a> in your browser:
</p>
<div class="example">
<pre class="example">javascript:location.href =
'org-protocol://roam-ref?template=r&amp;ref='
+ encodeURIComponent(location.href)
+ '&amp;title='
+ encodeURIComponent(document.title)
+ '&amp;body='
+ encodeURIComponent(window.getSelection())
</pre></div>
<p>or as a keybinding in <code>qutebrowser</code> in , using the <code>config.py</code> file (see
<a href="https://github.com/qutebrowser/qutebrowser/blob/master/doc/help/configuring.asciidoc">Configuring qutebrowser</a>):
</p>
<div class="example">
<pre class="example">config.bind(&quot;&lt;Ctrl-r&gt;&quot;, &quot;open javascript:location.href='org-protocol://roam-ref?template=r&amp;ref='+encodeURIComponent(location.href)+'&amp;title='+encodeURIComponent(document.title)&quot;)
</pre></div>
<p>where <code>template</code> is the template key for a template in
<code>org-roam-capture-ref-templates</code> (see <a href="#The-Templating-System">The Templating System</a>). These templates
should contain a <code>#+roam_key: ${ref}</code> in it.
</p>
<hr>
<span id="The-Templating-System"></span><div class="header">
<p>
Next: <a href="#Graphing" accesskey="n" rel="next">Graphing</a>, Previous: <a href="#Org_002droam-Protocol" accesskey="p" rel="prev">Org-roam Protocol</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> &nbsp; [<a href="#Keystroke-Index" title="Index" rel="index">Index</a>]</p>
</div>
<span id="The-Templating-System-1"></span><h2 class="chapter">11 The Templating System</h2>
<p>Org-roam extends the <code>org-capture</code> system, providing a smoother note-taking
experience. However, these extensions mean Org-roam capture templates are
incompatible with <code>org-capture</code> templates.
</p>
<p>Org-roam&rsquo;s templates are specified by <code>org-roam-capture-templates</code>. Just like
<code>org-capture-templates</code>, <code>org-roam-capture-templates</code> can contain multiple
templates. If <code>org-roam-capture-templates</code> only contains one template, there
will be no prompt for template selection.
</p>
<table class="menu" border="0" cellspacing="0">
<tr><td align="left" valign="top">&bull; <a href="#Template-Walkthrough" accesskey="1">Template Walkthrough</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">&bull; <a href="#Org_002droam-Template-Expansion" accesskey="2">Org-roam Template Expansion</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
</table>
<hr>
<span id="Template-Walkthrough"></span><div class="header">
<p>
Next: <a href="#Org_002droam-Template-Expansion" accesskey="n" rel="next">Org-roam Template Expansion</a>, Up: <a href="#The-Templating-System" accesskey="u" rel="up">The Templating System</a> &nbsp; [<a href="#Keystroke-Index" title="Index" rel="index">Index</a>]</p>
</div>
<span id="Template-Walkthrough-1"></span><h3 class="section">11.1 Template Walkthrough</h3>
<p>To demonstrate the additions made to org-capture templates. Here, we explain
the default template, reproduced below. You will find some most of the elements
of the template are similar to <code>org-capture</code> templates.
</p>
<div class="lisp">
<pre class="lisp">((&quot;d&quot; &quot;default&quot; plain &quot;%?&quot;
:if-new (file+head &quot;%&lt;%Y%m%d%H%M%S&gt;-${slug}.org&quot;
&quot;#+title: ${title}\n&quot;)
:unnarrowed t))
</pre></div>
<ul>
<li> The template has short key <code>&quot;d&quot;</code>. If you have only one template, org-roam
automatically chooses this template for you.
</li><li> The template is given a description of <code>&quot;default&quot;</code>.
</li><li> <code>plain</code> text is inserted. Other options include Org headings via
<code>entry</code>.
</li><li> Notice that the <code>target</code> that&rsquo;s usually in Org-capture templates is missing
here.
</li><li> <code>&quot;%?&quot;</code> is the template inserted on each call to <code>org-roam-capture-</code>.
This template means don&rsquo;t insert any content, but place the cursor here.
</li><li> <code>:if-new</code> is a compulsory specification in the Org-roam capture template.
This indicates the location for the new node.
</li><li> <code>:unnarrowed t</code> tells org-capture to show the contents for the whole file,
rather than narrowing to just the entry. This is part of the Org-capture
templates.
</li></ul>
<p>See the <code>org-roam-capture-templates</code> documentation for more details and
customization options.
</p>
<hr>
<span id="Org_002droam-Template-Expansion"></span><div class="header">
<p>
Previous: <a href="#Template-Walkthrough" accesskey="p" rel="prev">Template Walkthrough</a>, Up: <a href="#The-Templating-System" accesskey="u" rel="up">The Templating System</a> &nbsp; [<a href="#Keystroke-Index" title="Index" rel="index">Index</a>]</p>
</div>
<span id="Org_002droam-Template-Expansion-1"></span><h3 class="section">11.2 Org-roam Template Expansion</h3>
<p>Org-roam&rsquo;s template definitions also extend org-capture&rsquo;s template syntax, to
allow prefilling of strings. We have seen a glimpse of this in <a href="#Template-Walkthrough">Template
Walkthrough</a>.
</p>
<p>Org-roam provides the <code>${foo}</code> syntax for substituting variables with known
strings. <code>${foo}</code>&rsquo;s substitution is performed as follows:
</p>
<ul>
<li> If <code>foo</code> is a function, <code>foo</code> is called with the current node as its
argument.
</li><li> Else if <code>org-roam-node-foo</code> is a function, <code>foo</code> is called with the current node
as its argument. The <code>org-roam-node-</code> prefix defines many of Org-roam&rsquo;s node
accessors such as <code>org-roam-node-title</code> and <code>org-roam-node-level</code>.
</li><li> Else look up <code>org-roam-capture--info</code> for <code>foo</code>. This is an internal variable
that is set before the capture process begins.
</li><li> If none of the above applies, read a string using <code>completing-read</code>.
</li></ul>
<hr>
<span id="Graphing"></span><div class="header">
<p>
Next: <a href="#Org_002droam-Dailies" accesskey="n" rel="next">Org-roam Dailies</a>, Previous: <a href="#The-Templating-System" accesskey="p" rel="prev">The Templating System</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> &nbsp; [<a href="#Keystroke-Index" title="Index" rel="index">Index</a>]</p>
</div>
<span id="Graphing-1"></span><h2 class="chapter">12 Graphing</h2>
<p>Org-roam provides basic graphing capabilities to explore interconnections
between notes, in <code>org-roam-graph</code>. This is done by performing SQL queries and
generating images using <a href="https://graphviz.org/">Graphviz</a>. The graph can also be navigated: see <a href="#Org_002droam-Protocol">Roam
Protocol</a>.
</p>
<p>The entry point to graph creation is <code>org-roam-graph</code>.
</p>
<dl>
<dt id="index-org_002droam_002dgraph">Function: <strong>org-roam-graph</strong> <em>&amp; optional arg node</em></dt>
</dl>
<p>Build and display a graph for NODE.
ARG may be any of the following values:
</p>
<ul>
<li> <code>nil</code> show the full graph.
</li><li> <code>integer</code> an integer argument <code>N</code> will show the graph for the connected
components to node up to <code>N</code> steps away.
</li></ul>
<dl>
<dt id="index-org_002droam_002dgraph_002dexecutable">User Option: <strong>org-roam-graph-executable</strong></dt>
<dd>
<p>Path to the graphing executable (in this case, Graphviz). Set this if Org-roam
is unable to find the Graphviz executable on your system.
</p>
<p>You may also choose to use <code>neato</code> in place of <code>dot</code>, which generates a more
compact graph layout.
</p></dd></dl>
<dl>
<dt id="index-org_002droam_002dgraph_002dviewer">User Option: <strong>org-roam-graph-viewer</strong></dt>
<dd>
<p>Org-roam defaults to using Firefox (located on PATH) to view the SVG, but you
may choose to set it to:
</p>
<ul>
<li> A string, which is a path to the program used
</li><li> a function accepting a single argument: the graph file path.
</li></ul>
<p><code>nil</code> uses <code>view-file</code> to view the graph.
</p>
<p>If you are using WSL2 and would like to open the graph in Windows, you can use
the second option to set the browser and network file path:
</p>
<div class="lisp">
<pre class="lisp">(setq org-roam-graph-viewer
(lambda (file)
(let ((org-roam-graph-viewer &quot;/mnt/c/Program Files/Mozilla Firefox/firefox.exe&quot;))
(org-roam-graph--open (concat &quot;file://///wsl$/Ubuntu&quot; file)))))
</pre></div>
</dd></dl>
<table class="menu" border="0" cellspacing="0">
<tr><td align="left" valign="top">&bull; <a href="#Graph-Options" accesskey="1">Graph Options</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
</table>
<hr>
<span id="Graph-Options"></span><div class="header">
<p>
Up: <a href="#Graphing" accesskey="u" rel="up">Graphing</a> &nbsp; [<a href="#Keystroke-Index" title="Index" rel="index">Index</a>]</p>
</div>
<span id="Graph-Options-1"></span><h3 class="section">12.1 Graph Options</h3>
<p>Graphviz provides many options for customizing the graph output, and Org-roam
supports some of them. See <a href="https://graphviz.gitlab.io/_pages/doc/info/attrs.html">https://graphviz.gitlab.io/_pages/doc/info/attrs.html</a>
for customizable options.
</p>
<dl>
<dt id="index-org_002droam_002dgraph_002dfiletype">User Option: <strong>org-roam-graph-filetype</strong></dt>
<dd>
<p>The file type to generate for graphs. This defaults to <code>&quot;svg&quot;</code>.
</p></dd></dl>
<dl>
<dt id="index-org_002droam_002dgraph_002dextra_002dconfig">User Option: <strong>org-roam-graph-extra-config</strong></dt>
<dd>
<p>Extra options passed to graphviz for the digraph (The &ldquo;G&rdquo; attributes).
Example: <code>'~((&quot;rankdir&quot; . &quot;LR&quot;))</code>
</p></dd></dl>
<dl>
<dt id="index-org_002droam_002dgraph_002dnode_002dextra_002dconfig">User Option: <strong>org-roam-graph-node-extra-config</strong></dt>
<dd>
<p>An alist of options to style the nodes.
The car of the alist node type such as <code>&quot;id&quot;</code>, or <code>&quot;http&quot;</code>. The cdr of the
list is another alist of Graphviz node options (the &ldquo;N&rdquo; attributes).
</p></dd></dl>
<dl>
<dt id="index-org_002droam_002dgraph_002dedge_002dextra_002dconfig">User Option: <strong>org-roam-graph-edge-extra-config</strong></dt>
<dd>
<p>Extra options for edges in the graphviz output (The &ldquo;E&rdquo; attributes).
Example: <code>'((&quot;dir&quot; . &quot;back&quot;))</code>
</p></dd></dl>
<hr>
<span id="Org_002droam-Dailies"></span><div class="header">
<p>
Next: <a href="#Performance-Optimization" accesskey="n" rel="next">Performance Optimization</a>, Previous: <a href="#Graphing" accesskey="p" rel="prev">Graphing</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> &nbsp; [<a href="#Keystroke-Index" title="Index" rel="index">Index</a>]</p>
</div>
<span id="Org_002droam-Dailies-1"></span><h2 class="chapter">13 Org-roam Dailies</h2>
<p>Org-roam provides journaling capabilities akin to
Org-journal with <code>org-roam-dailies</code>.
</p>
<table class="menu" border="0" cellspacing="0">
<tr><td align="left" valign="top">&bull; <a href="#Configuration" accesskey="1">Configuration</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">&bull; <a href="#Usage" accesskey="2">Usage</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
</table>
<hr>
<span id="Configuration"></span><div class="header">
<p>
Next: <a href="#Usage" accesskey="n" rel="next">Usage</a>, Up: <a href="#Org_002droam-Dailies" accesskey="u" rel="up">Org-roam Dailies</a> &nbsp; [<a href="#Keystroke-Index" title="Index" rel="index">Index</a>]</p>
</div>
<span id="Configuration-1"></span><h3 class="section">13.1 Configuration</h3>
<p>For <code>org-roam-dailies</code> to work, you need to define two variables:
</p>
<dl>
<dt id="index-org_002droam_002ddailies_002ddirectory">Variable: <strong><code>org-roam-dailies-directory</code></strong></dt>
<dd>
<p>Path to daily-notes. This path is relative to <code>org-roam-directory</code>.
</p></dd></dl>
<dl>
<dt id="index-org_002droam_002ddailies_002dcapture_002dtemplates">Variable: <strong><code>org-roam-dailies-capture-templates</code></strong></dt>
<dd>
<p>Capture templates for daily-notes in Org-roam.
</p></dd></dl>
<p>Here is a sane default configuration:
</p>
<div class="lisp">
<pre class="lisp">(setq org-roam-dailies-directory &quot;daily/&quot;)
(setq org-roam-dailies-capture-templates
'((&quot;d&quot; &quot;default&quot; entry
&quot;* %?&quot;
:if-new (file+head &quot;%&lt;%Y-%m-%d&gt;.org&quot;
&quot;#+title: %&lt;%Y-%m-%d&gt;\n&quot;))))
</pre></div>
<p>See <a href="#The-Templating-System">The Templating System</a> for creating new templates.
</p>
<hr>
<span id="Usage"></span><div class="header">
<p>
Previous: <a href="#Configuration" accesskey="p" rel="prev">Configuration</a>, Up: <a href="#Org_002droam-Dailies" accesskey="u" rel="up">Org-roam Dailies</a> &nbsp; [<a href="#Keystroke-Index" title="Index" rel="index">Index</a>]</p>
</div>
<span id="Usage-1"></span><h3 class="section">13.2 Usage</h3>
<p><code>org-roam-dailies</code> provides these interactive functions:
</p>
<dl>
<dt id="index-org_002droam_002ddailies_002dcapture_002dtoday">Function: <strong><code>org-roam-dailies-capture-today</code></strong> <em>&amp;optional goto</em></dt>
<dd>
<p>Create an entry in the daily note for today.
</p>
<p>When <code>goto</code> is non-nil, go to the note without creating an entry.
</p></dd></dl>
<dl>
<dt id="index-org_002droam_002ddailies_002dgoto_002dtoday">Function: <strong><code>org-roam-dailies-goto-today</code></strong></dt>
<dd>
<p>Find the daily note for today, creating it if necessary.
</p></dd></dl>
<p>There are variants of those commands for <code>-yesterday</code> and <code>-tomorrow</code>:
</p>
<dl>
<dt id="index-org_002droam_002ddailies_002dcapture_002dyesterday">Function: <strong><code>org-roam-dailies-capture-yesterday</code></strong> <em>n &amp;optional goto</em></dt>
<dd>
<p>Create an entry in the daily note for yesteday.
</p>
<p>With numeric argument <code>n</code>, use the daily note <code>n</code> days in the past.
</p></dd></dl>
<dl>
<dt id="index-org_002droam_002ddailies_002dgoto_002dyesterday">Function: <strong><code>org-roam-dailies-goto-yesterday</code></strong></dt>
<dd>
<p>With numeric argument N, use the daily-note N days in the future.
</p></dd></dl>
<p>There are also commands which allow you to use Emacss <code>calendar</code> to find the date
</p>
<dl>
<dt id="index-org_002droam_002ddailies_002dcapture_002ddate">Function: <strong><code>org-roam-dailies-capture-date</code></strong></dt>
<dd>
<p>Create an entry in the daily note for a date using the calendar.
</p>
<p>Prefer past dates, unless <code>prefer-future</code> is non-nil.
</p>
<p>With a &rsquo;C-u&rsquo; prefix or when <code>goto</code> is non-nil, go the note without
creating an entry.
</p></dd></dl>
<dl>
<dt id="index-org_002droam_002ddailies_002dgoto_002ddate">Function: <strong><code>org-roam-dailies-goto-date</code></strong></dt>
<dd>
<p>Find the daily note for a date using the calendar, creating it if necessary.
</p>
<p>Prefer past dates, unless <code>prefer-future</code> is non-nil.
</p></dd></dl>
<dl>
<dt id="index-org_002droam_002ddailies_002dfind_002ddirectory">Function: <strong><code>org-roam-dailies-find-directory</code></strong></dt>
<dd>
<p>Find and open <code>org-roam-dailies-directory</code>.
</p></dd></dl>
<dl>
<dt id="index-org_002droam_002ddailies_002dgoto_002dprevious_002dnote">Function: <strong><code>org-roam-dailies-goto-previous-note</code></strong></dt>
<dd>
<p>When in an daily-note, find the previous one.
</p></dd></dl>
<dl>
<dt id="index-org_002droam_002ddailies_002dgoto_002dnext_002dnote">Function: <strong><code>org-roam-dailies-goto-next-note</code></strong></dt>
<dd>
<p>When in an daily-note, find the next one.
</p></dd></dl>
<hr>
<span id="Performance-Optimization"></span><div class="header">
<p>
Next: <a href="#The-Org_002dmode-Ecosystem" accesskey="n" rel="next">The Org-mode Ecosystem</a>, Previous: <a href="#Org_002droam-Dailies" accesskey="p" rel="prev">Org-roam Dailies</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> &nbsp; [<a href="#Keystroke-Index" title="Index" rel="index">Index</a>]</p>
</div>
<span id="Performance-Optimization-1"></span><h2 class="chapter">14 Performance Optimization</h2>
<table class="menu" border="0" cellspacing="0">
<tr><td align="left" valign="top">&bull; <a href="#Garbage-Collection" accesskey="1">Garbage Collection</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
</table>
<hr>
<span id="Garbage-Collection"></span><div class="header">
<p>
Up: <a href="#Performance-Optimization" accesskey="u" rel="up">Performance Optimization</a> &nbsp; [<a href="#Keystroke-Index" title="Index" rel="index">Index</a>]</p>
</div>
<span id="Garbage-Collection-1"></span><h3 class="section">14.1 Garbage Collection</h3>
<p>During the cache-build process, Org-roam generates a lot of in-memory
data-structures (such as the Org file&rsquo;s AST), which are discarded after use.
These structures are garbage collected at regular intervals (see <a href="https://www.gnu.org/software/emacs/manual/html_mono/elisp.html#Garbage-Collection">(elisp)info:elisp#Garbage Collection</a>).
</p>
<p>Org-roam provides the option <code>org-roam-db-gc-threshold</code> to temporarily change
the threshold value for GC to be triggered during these memory-intensive
operations. To reduce the number of garbage collection processes, one may set
<code>org-roam-db-gc-threshold</code> to a high value (such as <code>most-positive-fixnum</code>):
</p>
<div class="lisp">
<pre class="lisp">(setq org-roam-db-gc-threshold most-positive-fixnum)
</pre></div>
<hr>
<span id="The-Org_002dmode-Ecosystem"></span><div class="header">
<p>
Next: <a href="#FAQ" accesskey="n" rel="next">FAQ</a>, Previous: <a href="#Performance-Optimization" accesskey="p" rel="prev">Performance Optimization</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> &nbsp; [<a href="#Keystroke-Index" title="Index" rel="index">Index</a>]</p>
</div>
<span id="The-Org_002dmode-Ecosystem-1"></span><h2 class="chapter">15 The Org-mode Ecosystem</h2>
<p>Because Org-roam is built on top of Org-mode, it benefits from the vast number
of packages already available.
</p>
<table class="menu" border="0" cellspacing="0">
<tr><td align="left" valign="top">&bull; <a href="#Browsing-History-with-winner_002dmode" accesskey="1">Browsing History with winner-mode</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">&bull; <a href="#Versioning-Notes" accesskey="2">Versioning Notes</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">&bull; <a href="#Full_002dtext-search-with-Deft" accesskey="3">Full-text search with Deft</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">&bull; <a href="#Org_002djournal" accesskey="4">Org-journal</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">&bull; <a href="#Org_002ddownload" accesskey="5">Org-download</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">&bull; <a href="#mathpixel" accesskey="6">mathpix.el</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">&bull; <a href="#Org_002dnoter-_002f-Interleave" accesskey="7">Org-noter / Interleave</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">&bull; <a href="#Bibliography" accesskey="8">Bibliography</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">&bull; <a href="#Spaced-Repetition" accesskey="9">Spaced Repetition</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
</table>
<hr>
<span id="Browsing-History-with-winner_002dmode"></span><div class="header">
<p>
Next: <a href="#Versioning-Notes" accesskey="n" rel="next">Versioning Notes</a>, Up: <a href="#The-Org_002dmode-Ecosystem" accesskey="u" rel="up">The Org-mode Ecosystem</a> &nbsp; [<a href="#Keystroke-Index" title="Index" rel="index">Index</a>]</p>
</div>
<span id="Browsing-History-with-winner_002dmode-1"></span><h3 class="section">15.1 Browsing History with winner-mode</h3>
<p><code>winner-mode</code> is a global minor mode that allows one to undo and redo changes in
the window configuration. It is included with GNU Emacs since version 20.
</p>
<p><code>winner-mode</code> can be used as a simple version of browser history for Org-roam.
Each click through org-roam links (from both Org files and the backlinks buffer)
causes changes in window configuration, which can be undone and redone using
<code>winner-mode</code>. To use <code>winner-mode</code>, simply enable it, and bind the appropriate
interactive functions:
</p>
<div class="lisp">
<pre class="lisp">(winner-mode +1)
(define-key winner-mode-map (kbd &quot;&lt;M-left&gt;&quot;) #'winner-undo)
(define-key winner-mode-map (kbd &quot;&lt;M-right&gt;&quot;) #'winner-redo)
</pre></div>
<hr>
<span id="Versioning-Notes"></span><div class="header">
<p>
Next: <a href="#Full_002dtext-search-with-Deft" accesskey="n" rel="next">Full-text search with Deft</a>, Previous: <a href="#Browsing-History-with-winner_002dmode" accesskey="p" rel="prev">Browsing History with winner-mode</a>, Up: <a href="#The-Org_002dmode-Ecosystem" accesskey="u" rel="up">The Org-mode Ecosystem</a> &nbsp; [<a href="#Keystroke-Index" title="Index" rel="index">Index</a>]</p>
</div>
<span id="Versioning-Notes-1"></span><h3 class="section">15.2 Versioning Notes</h3>
<p>Since Org-roam notes are just plain text, it is trivial to track changes in your
notes database using version control systems such as <a href="https://git-scm.com/">Git</a>. Simply initialize
<code>org-roam-directory</code> as a Git repository, and commit your files at regular or
appropriate intervals. <a href="https://magit.vc/">Magit</a> is a great interface to Git within Emacs.
</p>
<p>In addition, it may be useful to observe how a particular note has evolved, by
looking at the file history. <a href="https://gitlab.com/pidu/git-timemachine">Git-timemachine</a> allows you to visit historic
versions of a tracked Org-roam note.
</p>
<hr>
<span id="Full_002dtext-search-with-Deft"></span><div class="header">
<p>
Next: <a href="#Org_002djournal" accesskey="n" rel="next">Org-journal</a>, Previous: <a href="#Versioning-Notes" accesskey="p" rel="prev">Versioning Notes</a>, Up: <a href="#The-Org_002dmode-Ecosystem" accesskey="u" rel="up">The Org-mode Ecosystem</a> &nbsp; [<a href="#Keystroke-Index" title="Index" rel="index">Index</a>]</p>
</div>
<span id="Full_002dtext-search-with-Deft-1"></span><h3 class="section">15.3 Full-text search with Deft</h3>
<p><a href="https://jblevins.org/projects/deft/">Deft</a> provides a nice interface for browsing and filtering org-roam notes.
</p>
<div class="lisp">
<pre class="lisp">(use-package deft
:after org
:bind
(&quot;C-c n d&quot; . deft)
:custom
(deft-recursive t)
(deft-use-filter-string-for-filename t)
(deft-default-extension &quot;org&quot;)
(deft-directory org-roam-directory))
</pre></div>
<p>The Deft interface can slow down quickly when the number of files get huge.
<a href="https://github.com/hasu/notdeft">Notdeft</a> is a fork of Deft that uses an external search engine and indexer.
</p>
<hr>
<span id="Org_002djournal"></span><div class="header">
<p>
Next: <a href="#Org_002ddownload" accesskey="n" rel="next">Org-download</a>, Previous: <a href="#Full_002dtext-search-with-Deft" accesskey="p" rel="prev">Full-text search with Deft</a>, Up: <a href="#The-Org_002dmode-Ecosystem" accesskey="u" rel="up">The Org-mode Ecosystem</a> &nbsp; [<a href="#Keystroke-Index" title="Index" rel="index">Index</a>]</p>
</div>
<span id="Org_002djournal-1"></span><h3 class="section">15.4 Org-journal</h3>
<p><a href="https://github.com/bastibe/org-journal">Org-journal</a> provides journaling capabilities to Org-mode. A lot of its
functionalities have been incorporated into Org-roam under the name
<a href="#Org_002droam-Dailies"><code>org-roam-dailies</code></a>. It remains a good tool if you want to isolate your verbose
journal entries from the ideas you would write on a scratchpad.
</p>
<div class="lisp">
<pre class="lisp">(use-package org-journal
:bind
(&quot;C-c n j&quot; . org-journal-new-entry)
:custom
(org-journal-date-prefix &quot;#+title: &quot;)
(org-journal-file-format &quot;%Y-%m-%d.org&quot;)
(org-journal-dir &quot;/path/to/journal/files/&quot;)
(org-journal-date-format &quot;%A, %d %B %Y&quot;))
</pre></div>
<hr>
<span id="Org_002ddownload"></span><div class="header">
<p>
Next: <a href="#mathpixel" accesskey="n" rel="next">mathpixel</a>, Previous: <a href="#Org_002djournal" accesskey="p" rel="prev">Org-journal</a>, Up: <a href="#The-Org_002dmode-Ecosystem" accesskey="u" rel="up">The Org-mode Ecosystem</a> &nbsp; [<a href="#Keystroke-Index" title="Index" rel="index">Index</a>]</p>
</div>
<span id="Org_002ddownload-1"></span><h3 class="section">15.5 Org-download</h3>
<p><a href="https://github.com/abo-abo/org-download">Org-download</a> lets you screenshot and yank images from the web into your notes:
</p>
<div class="float">
<img src="images/org-download.gif" alt="images/org-download">
<div class="float-caption"><p><strong>Figure: </strong>org-download</p></div></div>
<div class="lisp">
<pre class="lisp">(use-package org-download
:after org
:bind
(:map org-mode-map
((&quot;s-Y&quot; . org-download-screenshot)
(&quot;s-y&quot; . org-download-yank))))
</pre></div>
<hr>
<span id="mathpixel"></span><div class="header">
<p>
Next: <a href="#Org_002dnoter-_002f-Interleave" accesskey="n" rel="next">Org-noter / Interleave</a>, Previous: <a href="#Org_002ddownload" accesskey="p" rel="prev">Org-download</a>, Up: <a href="#The-Org_002dmode-Ecosystem" accesskey="u" rel="up">The Org-mode Ecosystem</a> &nbsp; [<a href="#Keystroke-Index" title="Index" rel="index">Index</a>]</p>
</div>
<span id="mathpix_002eel"></span><h3 class="section">15.6 mathpix.el</h3>
<p><a href="https://github.com/jethrokuan/mathpix.el">mathpix.el</a> uses <a href="https://mathpix.com/">Mathpix&rsquo;s</a> API to convert clips into latex equations:
</p>
<div class="float">
<img src="images/mathpix.gif" alt="images/mathpix">
<div class="float-caption"><p><strong>Figure: </strong>mathpix</p></div></div>
<div class="lisp">
<pre class="lisp">(use-package mathpix.el
:straight (:host github :repo &quot;jethrokuan/mathpix.el&quot;)
:custom ((mathpix-app-id &quot;app-id&quot;)
(mathpix-app-key &quot;app-key&quot;))
:bind
(&quot;C-x m&quot; . mathpix-screenshot))
</pre></div>
<hr>
<span id="Org_002dnoter-_002f-Interleave"></span><div class="header">
<p>
Next: <a href="#Bibliography" accesskey="n" rel="next">Bibliography</a>, Previous: <a href="#mathpixel" accesskey="p" rel="prev">mathpixel</a>, Up: <a href="#The-Org_002dmode-Ecosystem" accesskey="u" rel="up">The Org-mode Ecosystem</a> &nbsp; [<a href="#Keystroke-Index" title="Index" rel="index">Index</a>]</p>
</div>
<span id="Org_002dnoter-_002f-Interleave-1"></span><h3 class="section">15.7 Org-noter / Interleave</h3>
<p><a href="https://github.com/weirdNox/org-noter">Org-noter</a> and <a href="https://github.com/rudolfochrist/interleave">Interleave</a> are both projects that allow synchronised annotation of
documents (PDF, EPUB etc.) within Org-mode.
</p>
<hr>
<span id="Bibliography"></span><div class="header">
<p>
Next: <a href="#Spaced-Repetition" accesskey="n" rel="next">Spaced Repetition</a>, Previous: <a href="#Org_002dnoter-_002f-Interleave" accesskey="p" rel="prev">Org-noter / Interleave</a>, Up: <a href="#The-Org_002dmode-Ecosystem" accesskey="u" rel="up">The Org-mode Ecosystem</a> &nbsp; [<a href="#Keystroke-Index" title="Index" rel="index">Index</a>]</p>
</div>
<span id="Bibliography-1"></span><h3 class="section">15.8 Bibliography</h3>
<p><a href="https://github.com/org-roam/org-roam-bibtex">org-roam-bibtex</a> offers tight integration between <a href="https://github.com/jkitchin/org-ref">org-ref</a>, <a href="https://github.com/tmalsburg/helm-bibtex">helm-bibtex</a> and
<code>org-roam</code>. This helps you manage your bibliographic notes under <code>org-roam</code>.
</p>
<p>For example, though helm-bibtex provides the ability to visit notes for
bibliographic entries, org-roam-bibtex extends it with the ability to visit the
file with the right &lsquo;<samp>#+ROAM_KEYS</samp>&rsquo;.
</p>
<hr>
<span id="Spaced-Repetition"></span><div class="header">
<p>
Previous: <a href="#Bibliography" accesskey="p" rel="prev">Bibliography</a>, Up: <a href="#The-Org_002dmode-Ecosystem" accesskey="u" rel="up">The Org-mode Ecosystem</a> &nbsp; [<a href="#Keystroke-Index" title="Index" rel="index">Index</a>]</p>
</div>
<span id="Spaced-Repetition-1"></span><h3 class="section">15.9 Spaced Repetition</h3>
<p><a href="https://www.leonrische.me/fc/index.html">Org-fc</a> is a spaced repetition system that scales well with a large number of
files. Other alternatives include <a href="https://orgmode.org/worg/org-contrib/org-drill.html">org-drill</a>, and <a href="https://github.com/abo-abo/pamparam">pamparam</a>.
</p>
<p>To use Anki for spaced repetition, <a href="https://github.com/louietan/anki-editor">anki-editor</a> allows you to write your cards in
Org-mode, and sync your cards to Anki via <a href="https://github.com/FooSoft/anki-connect#installation">anki-connect</a>.
</p>
<hr>
<span id="FAQ"></span><div class="header">
<p>
Next: <a href="#Migrating-from-Org_002droam-v1" accesskey="n" rel="next">Migrating from Org-roam v1</a>, Previous: <a href="#The-Org_002dmode-Ecosystem" accesskey="p" rel="prev">The Org-mode Ecosystem</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> &nbsp; [<a href="#Keystroke-Index" title="Index" rel="index">Index</a>]</p>
</div>
<span id="FAQ-1"></span><h2 class="chapter">16 FAQ</h2>
<table class="menu" border="0" cellspacing="0">
<tr><td align="left" valign="top">&bull; <a href="#How-do-I-have-more-than-one-Org_002droam-directory_003f" accesskey="1">How do I have more than one Org-roam directory?</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">&bull; <a href="#How-do-I-migrate-from-Roam-Research_003f" accesskey="2">How do I migrate from Roam Research?</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">&bull; <a href="#How-do-I-create-a-note-whose-title-already-matches-one-of-the-candidates_003f" accesskey="3">How do I create a note whose title already matches one of the candidates?</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
</table>
<hr>
<span id="How-do-I-have-more-than-one-Org_002droam-directory_003f"></span><div class="header">
<p>
Next: <a href="#How-do-I-migrate-from-Roam-Research_003f" accesskey="n" rel="next">How do I migrate from Roam Research?</a>, Up: <a href="#FAQ" accesskey="u" rel="up">FAQ</a> &nbsp; [<a href="#Keystroke-Index" title="Index" rel="index">Index</a>]</p>
</div>
<span id="How-do-I-have-more-than-one-Org_002droam-directory_003f-1"></span><h3 class="section">16.1 How do I have more than one Org-roam directory?</h3>
<p>Emacs supports directory-local variables, allowing the value of
<code>org-roam-directory</code> to be different in different directories. It does this by
checking for a file named <code>.dir-locals.el</code>.
</p>
<p>To add support for multiple directories, override the <code>org-roam-directory</code>
variable using directory-local variables. This is what <code>.dir-locals.el</code> may
contain:
</p>
<div class="lisp">
<pre class="lisp">((nil . ((org-roam-directory . (expand-file-name &quot;.&quot;))
(org-roam-db-location . (expand-file-name &quot;./org-roam.db&quot;)))))
</pre></div>
<p>All files within that directory will be treated as their own separate set of
Org-roam files. Remember to run <code>org-roam-db-sync</code> from a file within
that directory, at least once.
</p>
<hr>
<span id="How-do-I-migrate-from-Roam-Research_003f"></span><div class="header">
<p>
Next: <a href="#How-do-I-create-a-note-whose-title-already-matches-one-of-the-candidates_003f" accesskey="n" rel="next">How do I create a note whose title already matches one of the candidates?</a>, Previous: <a href="#How-do-I-have-more-than-one-Org_002droam-directory_003f" accesskey="p" rel="prev">How do I have more than one Org-roam directory?</a>, Up: <a href="#FAQ" accesskey="u" rel="up">FAQ</a> &nbsp; [<a href="#Keystroke-Index" title="Index" rel="index">Index</a>]</p>
</div>
<span id="How-do-I-migrate-from-Roam-Research_003f-1"></span><h3 class="section">16.2 How do I migrate from Roam Research?</h3>
<p>Fabio has produced a command-line tool that converts markdown files exported
from Roam Research into Org-roam compatible markdown. More instructions are
provided <a href="https://github.com/fabioberger/roam-migration">in the repository</a>.
</p>
<hr>
<span id="How-do-I-create-a-note-whose-title-already-matches-one-of-the-candidates_003f"></span><div class="header">
<p>
Previous: <a href="#How-do-I-migrate-from-Roam-Research_003f" accesskey="p" rel="prev">How do I migrate from Roam Research?</a>, Up: <a href="#FAQ" accesskey="u" rel="up">FAQ</a> &nbsp; [<a href="#Keystroke-Index" title="Index" rel="index">Index</a>]</p>
</div>
<span id="How-do-I-create-a-note-whose-title-already-matches-one-of-the-candidates_003f-1"></span><h3 class="section">16.3 How do I create a note whose title already matches one of the candidates?</h3>
<p>This situation arises when, for example, one would like to create a note titled
&ldquo;bar&rdquo; when &ldquo;barricade&rdquo; already exists.
</p>
<p>The solution is dependent on the mini-buffer completion framework in use. Here
are the solutions:
</p>
<ul>
<li> Ivycall <code>ivy-immediate-done</code>, typically bound to <code>C-M-j</code>. Alternatively,
set <code>ivy-use-selectable-prompt</code> to <code>t</code>, so that &ldquo;bar&rdquo; is now selectable.
</li><li> HelmOrg-roam should provide a selectable &ldquo;[?] bar&rdquo; candidate at the top of
the candidate list.
</li></ul>
<hr>
<span id="Migrating-from-Org_002droam-v1"></span><div class="header">
<p>
Next: <a href="#Developer_0027s-Guide-to-Org_002droam" accesskey="n" rel="next">Developer's Guide to Org-roam</a>, Previous: <a href="#FAQ" accesskey="p" rel="prev">FAQ</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> &nbsp; [<a href="#Keystroke-Index" title="Index" rel="index">Index</a>]</p>
</div>
<span id="Migrating-from-Org_002droam-v1-1"></span><h2 class="chapter">17 Migrating from Org-roam v1</h2>
<p>Those coming from Org-roam v1 will do well treating v2 as entirely new software.
V2 has a smaller core and fewer moving parts, while retaining the bulk of its
functionality. It is recommended to read the documentation above about nodes.
</p>
<p>It is still desirable to migrate notes collected in v1 to v2. To migrate your v1
notes to v2, you may use the migration script provided in <a href="https://gist.github.com/jethrokuan/02f41028fb4a6f81787dc420fb99b6e4">this gist</a>, or <a href="https://gist.github.com/jethrokuan/02f41028fb4a6f81787dc420fb99b6e4#gistcomment-3737019">this
gist</a>, the latter being better tested. <a href="https://d12frosted.io/posts/2021-06-11-path-to-org-roam-v2.html">This blog post</a> provides a good overview of
what&rsquo;s new in v2 and how to migrate.
</p>
<p>Simply put, to migrate notes from v1 to v2, one must:
</p>
<ul>
<li> Add IDs to all existing notes. These are located in top-level property
drawers (Although note that in v2, not all files need to have IDs)
</li><li> Update the Org-roam database to conform to the new schema.
</li><li> Replace <code>#+ROAM_KEY</code> into the <code>ROAM_REFS</code> property
</li><li> Replace <code>#+ROAM_ALIAS</code> into the <code>ROAM_ALIASES</code> property
</li><li> Move <code>#+ROAM_TAGS</code> into the <code>#+FILETAGS</code> property for file-level nodes, and
the <code>ROAM_TAGS</code> property for headline nodes
</li><li> Replace existing file links with ID links.
</li></ul>
<hr>
<span id="Developer_0027s-Guide-to-Org_002droam"></span><div class="header">
<p>
Next: <a href="#Appendix" accesskey="n" rel="next">Appendix</a>, Previous: <a href="#Migrating-from-Org_002droam-v1" accesskey="p" rel="prev">Migrating from Org-roam v1</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> &nbsp; [<a href="#Keystroke-Index" title="Index" rel="index">Index</a>]</p>
</div>
<span id="Developer_0027s-Guide-to-Org_002droam-1"></span><h2 class="chapter">18 Developer&rsquo;s Guide to Org-roam</h2>
<table class="menu" border="0" cellspacing="0">
<tr><td align="left" valign="top">&bull; <a href="#Org_002droam_0027s-Design-Principle" accesskey="1">Org-roam's Design Principle</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">&bull; <a href="#Building-Extensions-and-Advanced-Customization-of-Org_002droam" accesskey="2">Building Extensions and Advanced Customization of Org-roam</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
</table>
<hr>
<span id="Org_002droam_0027s-Design-Principle"></span><div class="header">
<p>
Next: <a href="#Building-Extensions-and-Advanced-Customization-of-Org_002droam" accesskey="n" rel="next">Building Extensions and Advanced Customization of Org-roam</a>, Up: <a href="#Developer_0027s-Guide-to-Org_002droam" accesskey="u" rel="up">Developer's Guide to Org-roam</a> &nbsp; [<a href="#Keystroke-Index" title="Index" rel="index">Index</a>]</p>
</div>
<span id="Org_002droam_0027s-Design-Principle-1"></span><h3 class="section">18.1 Org-roam&rsquo;s Design Principle</h3>
<p>Org-roam is primarily motivated by the need for a dual representation. We
(humans) love operating in a plain-text environment. The syntax rules of
Org-mode are simple and fit snugly within our brain. This also allows us to use
the tools and packages we love to explore and edit our notes. Org-mode is simply
the most powerful plain-text format available, with support for images, LaTeX,
TODO planning and much more.
</p>
<p>But this plain-text format is simply ill-suited for exploration of these notes:
plain-text is simply not amenable for answering large-scale, complex queries
(e.g. how many tasks do I have that are due by next week?). Interfaces such as
Org-agenda slow to a crawl when the number of files becomes unwieldy, which can
quickly become the case.
</p>
<p>At its core, Org-roam provides a database abstraction layer, providing a dual
representation of what&rsquo;s already available in plain-text. This allows us
(humans) to continue working with plain-text, while programs can utilize the
database layer to perform complex queries. These capabilities include, but are
not limited to:
</p>
<ul>
<li> link graph traversal and visualization
</li><li> Instantaneous SQL-like queries on headlines
<ul>
<li> What are my TODOs, scheduled for X, or due by Y?
</li></ul>
</li><li> Accessing the properties of a node, such as its tags, refs, TODO state or
priority
</li></ul>
<p>All of these functionality is powered by this database abstraction layer. Hence,
at its core Org-roam&rsquo;s primary goal is to provide a resilient dual
representation that is cheap to maintain, easy to understand, and is as
up-to-date as it possibly can. Org-roam also then exposes an API to this
database abstraction layer for users who would like to perform programmatic
queries on their Org files.
</p>
<hr>
<span id="Building-Extensions-and-Advanced-Customization-of-Org_002droam"></span><div class="header">
<p>
Previous: <a href="#Org_002droam_0027s-Design-Principle" accesskey="p" rel="prev">Org-roam's Design Principle</a>, Up: <a href="#Developer_0027s-Guide-to-Org_002droam" accesskey="u" rel="up">Developer's Guide to Org-roam</a> &nbsp; [<a href="#Keystroke-Index" title="Index" rel="index">Index</a>]</p>
</div>
<span id="Building-Extensions-and-Advanced-Customization-of-Org_002droam-1"></span><h3 class="section">18.2 Building Extensions and Advanced Customization of Org-roam</h3>
<p>Because Org-roam&rsquo;s core functionality is small, it is possible and sometimes
desirable to build extensions on top of it. These extensions may one or more of
the following functionalities:
</p>
<ul>
<li> Access to Org-roam&rsquo;s database
</li><li> Usage/modification of Org-roam&rsquo;s interactive commands
</li></ul>
<p>Org-roam provides no guarantees that extensions will continue to function as
Org-roam evolves, but by following these simple rules, extensions can be made
robust to local changes in Org-roam.
</p>
<ul>
<li> Extensions should not modify the database schema. Any extension that requires
the caching of additional data should make a request upstream to Org-roam.
</li><li> Extensions requiring access to the database should explicitly state support
for the database version (<code>org-roam-db-version</code>), and only conditionally
load when support is available.
</li></ul>
<table class="menu" border="0" cellspacing="0">
<tr><td align="left" valign="top">&bull; <a href="#Accessing-the-Database" accesskey="1">Accessing the Database</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">&bull; <a href="#Accessing-and-Modifying-Nodes" accesskey="2">Accessing and Modifying Nodes</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">&bull; <a href="#Extending-the-Capture-System" accesskey="3">Extending the Capture System</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
</table>
<hr>
<span id="Accessing-the-Database"></span><div class="header">
<p>
Next: <a href="#Accessing-and-Modifying-Nodes" accesskey="n" rel="next">Accessing and Modifying Nodes</a>, Up: <a href="#Building-Extensions-and-Advanced-Customization-of-Org_002droam" accesskey="u" rel="up">Building Extensions and Advanced Customization of Org-roam</a> &nbsp; [<a href="#Keystroke-Index" title="Index" rel="index">Index</a>]</p>
</div>
<span id="Accessing-the-Database-1"></span><h4 class="subsection">18.2.1 Accessing the Database</h4>
<p>Access to the database is provided singularly by <code>org-roam-db-query</code>, for
example:
</p>
<div class="lisp">
<pre class="lisp">(org-roam-db-query [:select * :from nodes])
</pre></div>
<p>One can refer to the database schema by looking up
<code>org-roam-db--table-schemata</code>. There are multiple helper functions within
Org-roam that call <code>org-roam-db-query</code>, these are subject to change. To ensure
that extensions/customizations are robust to change, extensions should only use
<code>org-roam-db-query</code>, and perhaps replicate the SQL query if necessary.
</p>
<hr>
<span id="Accessing-and-Modifying-Nodes"></span><div class="header">
<p>
Next: <a href="#Extending-the-Capture-System" accesskey="n" rel="next">Extending the Capture System</a>, Previous: <a href="#Accessing-the-Database" accesskey="p" rel="prev">Accessing the Database</a>, Up: <a href="#Building-Extensions-and-Advanced-Customization-of-Org_002droam" accesskey="u" rel="up">Building Extensions and Advanced Customization of Org-roam</a> &nbsp; [<a href="#Keystroke-Index" title="Index" rel="index">Index</a>]</p>
</div>
<span id="Accessing-and-Modifying-Nodes-1"></span><h4 class="subsection">18.2.2 Accessing and Modifying Nodes</h4>
<p>The node interface is cleanly defined using <code>cl-defstruct</code>. The primary
method to access nodes is <code>org-roam-node-at-point</code> and <code>org-roam-node-read</code>:
</p>
<dl>
<dt id="index-org_002droam_002dnode_002dat_002dpoint">Function: <strong>org-roam-node-at-point</strong> <em>&amp;optional assert</em></dt>
<dd>
<p>Return the node at point. If ASSERT, throw an error if there is no node at
point.
</p></dd></dl>
<dl>
<dt id="index-org_002droam_002dnode_002dread">Function: <strong>org-roam-node-read</strong> <em>&amp;optional initial-input filter-fn sort-fn</em></dt>
<dd><p>require-match
</p>
<p>Read and return an &lsquo;org-roam-node&rsquo;.
INITIAL-INPUT is the initial minibuffer prompt value. FILTER-FN
is a function to filter out nodes: it takes a single argument (an
<code>org-roam-node</code>), and when nil is returned the node will be
filtered out.
SORT-FN is a function to sort nodes. See <code>org-roam-node-sort-by-file-mtime</code>
for an example sort function.
If REQUIRE-MATCH, the minibuffer prompt will require a match.
</p></dd></dl>
<p>Once you obtain the node, you can use the accessors for the node, e.g.
<code>org-roam-node-id</code> or <code>org-roam-node-todo</code>.
</p>
<p>It is possible to define (or override existing) properties on nodes. This is
simply done using a <code>cl-defmethod</code> on the <code>org-roam-node</code> struct:
</p>
<div class="lisp">
<pre class="lisp">(cl-defmethod org-roam-node-namespace ((node org-roam-node))
&quot;Return the namespace for NODE.
The namespace is the final directory of the file for the node.&quot;
(file-name-nondirectory
(directory-file-name
(file-name-directory (org-roam-node-file node)))))
</pre></div>
<p>The snippet above defines a new property <code>namespace</code> on <code>org-roam-node</code>, which
making it available for use in capture templates.
</p>
<hr>
<span id="Extending-the-Capture-System"></span><div class="header">
<p>
Previous: <a href="#Accessing-and-Modifying-Nodes" accesskey="p" rel="prev">Accessing and Modifying Nodes</a>, Up: <a href="#Building-Extensions-and-Advanced-Customization-of-Org_002droam" accesskey="u" rel="up">Building Extensions and Advanced Customization of Org-roam</a> &nbsp; [<a href="#Keystroke-Index" title="Index" rel="index">Index</a>]</p>
</div>
<span id="Extending-the-Capture-System-1"></span><h4 class="subsection">18.2.3 Extending the Capture System</h4>
<p>Org-roam applies some patching over Org&rsquo;s capture system to smooth out the user
experience, and sometimes it is desirable to use Org-roam&rsquo;s capturing system
instead. The exposed function to be used in extensions is <code>org-roam-capture-</code>:
</p>
<dl>
<dt id="index-org_002droam_002dcapture_002d">Function: <strong>org-roam-capture-</strong> <em>&amp;key goto keys node info props templates</em></dt>
<dd>
<p>Main entry point.
GOTO and KEYS correspond to &lsquo;org-capture&rsquo; arguments.
INFO is an alist for filling up Org-roam&rsquo;s capture templates.
NODE is an &lsquo;org-roam-node&rsquo; construct containing information about the node.
PROPS is a plist containing additional Org-roam properties for each template.
TEMPLATES is a list of org-roam templates.
</p></dd></dl>
<p>An example of an extension using <code>org-roam-capture-</code> is <code>org-roam-dailies</code>
itself:
</p>
<div class="lisp">
<pre class="lisp">(defun org-roam-dailies--capture (time &amp;optional goto)
&quot;Capture an entry in a daily-note for TIME, creating it if necessary.
When GOTO is non-nil, go the note without creating an entry.&quot;
(org-roam-capture- :goto (when goto '(4))
:node (org-roam-node-create)
:templates org-roam-dailies-capture-templates
:props (list :override-default-time time))
(when goto (run-hooks 'org-roam-dailies-find-file-hook)))
</pre></div>
<hr>
<span id="Appendix"></span><div class="header">
<p>
Next: <a href="#Keystroke-Index" accesskey="n" rel="next">Keystroke Index</a>, Previous: <a href="#Developer_0027s-Guide-to-Org_002droam" accesskey="p" rel="prev">Developer's Guide to Org-roam</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> &nbsp; [<a href="#Keystroke-Index" title="Index" rel="index">Index</a>]</p>
</div>
<span id="Appendix-1"></span><h2 class="chapter">19 Appendix</h2>
<table class="menu" border="0" cellspacing="0">
<tr><td align="left" valign="top">&bull; <a href="#Note_002dtaking-Workflows" accesskey="1">Note-taking Workflows</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">&bull; <a href="#Ecosystem" accesskey="2">Ecosystem</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
</table>
<hr>
<span id="Note_002dtaking-Workflows"></span><div class="header">
<p>
Next: <a href="#Ecosystem" accesskey="n" rel="next">Ecosystem</a>, Up: <a href="#Appendix" accesskey="u" rel="up">Appendix</a> &nbsp; [<a href="#Keystroke-Index" title="Index" rel="index">Index</a>]</p>
</div>
<span id="Note_002dtaking-Workflows-1"></span><h3 class="section">19.1 Note-taking Workflows</h3>
<ul>
<li> Books<ul>
<li> <a href="https://www.goodreads.com/book/show/34507927-how-to-take-smart-notes">How To Take Smart Notes</a>
</li></ul>
</li><li> Articles<ul>
<li> <a href="https://www.lesswrong.com/posts/NfdHG6oHBJ8Qxc26s/the-zettelkasten-method-1">The Zettelkasten Method - LessWrong 2.0</a>
</li><li> <a href="https://reddit.com/r/RoamResearch/comments/eho7de/building_a_second_brain_in_roamand_why_you_might">Building a Second Brain in Roam&hellip;And Why You Might Want To : RoamResearch</a>
</li><li> <a href="https://www.nateliason.com/blog/roam">Roam Research: Why I Love It and How I Use It - Nat Eliason</a>
</li><li> <a href="https://twitter.com/adam_keesling/status/1196864424725774336?s=20">Adam Keesling&rsquo;s Twitter Thread</a>
</li><li> <a href="https://blog.jethro.dev/posts/how_to_take_smart_notes_org/">How To Take Smart Notes With Org-mode · Jethro Kuan</a>
</li></ul>
</li><li> Threads<ul>
<li> <a href="https://news.ycombinator.com/item?id=22473209">Ask HN: How to Take Good Notes</a>
</li></ul>
</li><li> Videos<ul>
<li> <a href="https://www.youtube.com/watch?v=RvWic15iXjk">How to Use Roam to Outline a New Article in Under 20 Minutes</a>
</li></ul>
</li></ul>
<hr>
<span id="Ecosystem"></span><div class="header">
<p>
Previous: <a href="#Note_002dtaking-Workflows" accesskey="p" rel="prev">Note-taking Workflows</a>, Up: <a href="#Appendix" accesskey="u" rel="up">Appendix</a> &nbsp; [<a href="#Keystroke-Index" title="Index" rel="index">Index</a>]</p>
</div>
<span id="Ecosystem-1"></span><h3 class="section">19.2 Ecosystem</h3>
<hr>
<span id="Keystroke-Index"></span><div class="header">
<p>
Next: <a href="#Command-Index" accesskey="n" rel="next">Command Index</a>, Previous: <a href="#Appendix" accesskey="p" rel="prev">Appendix</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> &nbsp; [<a href="#Keystroke-Index" title="Index" rel="index">Index</a>]</p>
</div>
<span id="Keystroke-Index-1"></span><h2 class="appendix">Appendix A Keystroke Index</h2>
<hr>
<span id="Command-Index"></span><div class="header">
<p>
Next: <a href="#Function-Index" accesskey="n" rel="next">Function Index</a>, Previous: <a href="#Keystroke-Index" accesskey="p" rel="prev">Keystroke Index</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> &nbsp; [<a href="#Keystroke-Index" title="Index" rel="index">Index</a>]</p>
</div>
<span id="Command-Index-1"></span><h2 class="appendix">Appendix B Command Index</h2>
<hr>
<span id="Function-Index"></span><div class="header">
<p>
Next: <a href="#Variable-Index" accesskey="n" rel="next">Variable Index</a>, Previous: <a href="#Command-Index" accesskey="p" rel="prev">Command Index</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> &nbsp; [<a href="#Keystroke-Index" title="Index" rel="index">Index</a>]</p>
</div>
<span id="Function-Index-1"></span><h2 class="appendix">Appendix C Function Index</h2>
<table><tr><th valign="top">Jump to: &nbsp; </th><td><a class="summary-letter" href="#Function-Index_fn_letter-O"><b>O</b></a>
&nbsp;
</td></tr></table>
<table class="index-fn" border="0">
<tr><td></td><th align="left">Index Entry</th><td>&nbsp;</td><th align="left"> Section</th></tr>
<tr><td colspan="4"> <hr></td></tr>
<tr><th id="Function-Index_fn_letter-O">O</th><td></td><td></td></tr>
<tr><td></td><td valign="top"><a href="#index-org_002droam_002dalias_002dadd"><code>org-roam-alias-add</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Titles-and-Aliases">Titles and Aliases</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-org_002droam_002dalias_002dremove"><code>org-roam-alias-remove</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Titles-and-Aliases">Titles and Aliases</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-org_002droam_002dbuffer"><code>org-roam-buffer</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-Org_002droam-Buffer">The Org-roam Buffer</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-org_002droam_002dbuffer_002dtoggle"><code>org-roam-buffer-toggle</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-Org_002droam-Buffer">The Org-roam Buffer</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-org_002droam_002dcapture_002d"><code>org-roam-capture-</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Extending-the-Capture-System">Extending the Capture System</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-org_002droam_002ddailies_002dcapture_002ddate"><code><code>org-roam-dailies-capture-date</code></code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Usage">Usage</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-org_002droam_002ddailies_002dcapture_002dtoday"><code><code>org-roam-dailies-capture-today</code></code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Usage">Usage</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-org_002droam_002ddailies_002dcapture_002dyesterday"><code><code>org-roam-dailies-capture-yesterday</code></code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Usage">Usage</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-org_002droam_002ddailies_002dfind_002ddirectory"><code><code>org-roam-dailies-find-directory</code></code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Usage">Usage</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-org_002droam_002ddailies_002dgoto_002ddate"><code><code>org-roam-dailies-goto-date</code></code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Usage">Usage</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-org_002droam_002ddailies_002dgoto_002dnext_002dnote"><code><code>org-roam-dailies-goto-next-note</code></code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Usage">Usage</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-org_002droam_002ddailies_002dgoto_002dprevious_002dnote"><code><code>org-roam-dailies-goto-previous-note</code></code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Usage">Usage</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-org_002droam_002ddailies_002dgoto_002dtoday"><code><code>org-roam-dailies-goto-today</code></code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Usage">Usage</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-org_002droam_002ddailies_002dgoto_002dyesterday"><code><code>org-roam-dailies-goto-yesterday</code></code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Usage">Usage</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-org_002droam_002dgraph"><code>org-roam-graph</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Graphing">Graphing</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-org_002droam_002dnode_002dat_002dpoint"><code>org-roam-node-at-point</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Accessing-and-Modifying-Nodes">Accessing and Modifying Nodes</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-org_002droam_002dnode_002dread"><code>org-roam-node-read</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Accessing-and-Modifying-Nodes">Accessing and Modifying Nodes</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-org_002droam_002dref_002dadd"><code>org-roam-ref-add</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Refs">Refs</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-org_002droam_002dref_002dremove"><code>org-roam-ref-remove</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Refs">Refs</a></td></tr>
<tr><td colspan="4"> <hr></td></tr>
</table>
<table><tr><th valign="top">Jump to: &nbsp; </th><td><a class="summary-letter" href="#Function-Index_fn_letter-O"><b>O</b></a>
&nbsp;
</td></tr></table>
<hr>
<span id="Variable-Index"></span><div class="header">
<p>
Previous: <a href="#Function-Index" accesskey="p" rel="prev">Function Index</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> &nbsp; [<a href="#Keystroke-Index" title="Index" rel="index">Index</a>]</p>
</div>
<span id="Variable-Index-1"></span><h2 class="appendix">Appendix D Variable Index</h2>
<table><tr><th valign="top">Jump to: &nbsp; </th><td><a class="summary-letter" href="#Variable-Index_vr_letter-O"><b>O</b></a>
&nbsp;
</td></tr></table>
<table class="index-vr" border="0">
<tr><td></td><th align="left">Index Entry</th><td>&nbsp;</td><th align="left"> Section</th></tr>
<tr><td colspan="4"> <hr></td></tr>
<tr><th id="Variable-Index_vr_letter-O">O</th><td></td><td></td></tr>
<tr><td></td><td valign="top"><a href="#index-org_002droam_002dcompletion_002deverywhere"><code>org-roam-completion-everywhere</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Completing-anywhere">Completing anywhere</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-org_002droam_002ddailies_002dcapture_002dtemplates"><code><code>org-roam-dailies-capture-templates</code></code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Configuration">Configuration</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-org_002droam_002ddailies_002ddirectory"><code><code>org-roam-dailies-directory</code></code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Configuration">Configuration</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-org_002droam_002dgraph_002dedge_002dextra_002dconfig"><code>org-roam-graph-edge-extra-config</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Graph-Options">Graph Options</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-org_002droam_002dgraph_002dexecutable"><code>org-roam-graph-executable</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Graphing">Graphing</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-org_002droam_002dgraph_002dextra_002dconfig"><code>org-roam-graph-extra-config</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Graph-Options">Graph Options</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-org_002droam_002dgraph_002dfiletype"><code>org-roam-graph-filetype</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Graph-Options">Graph Options</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-org_002droam_002dgraph_002dnode_002dextra_002dconfig"><code>org-roam-graph-node-extra-config</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Graph-Options">Graph Options</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-org_002droam_002dgraph_002dviewer"><code>org-roam-graph-viewer</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Graphing">Graphing</a></td></tr>
<tr><td colspan="4"> <hr></td></tr>
</table>
<table><tr><th valign="top">Jump to: &nbsp; </th><td><a class="summary-letter" href="#Variable-Index_vr_letter-O"><b>O</b></a>
&nbsp;
</td></tr></table>
<p>Emacs 28.0.50 (Org mode 9.5)
</p><div class="footnote">
<hr>
<h4 class="footnotes-heading">Footnotes</h4>
<h5><a id="FOOT1" href="#DOCF1">(1)</a></h3>
<p>To understand more about Roam, a collection of links are available in <a href="#Note_002dtaking-Workflows">Note-taking Workflows</a>.</p>
</div>
<hr>
</body>
</html>