mirror of
https://github.com/org-roam/org-roam
synced 2025-08-01 12:17:21 -05:00
2701 lines
138 KiB
HTML
2701 lines
138 KiB
HTML
<!DOCTYPE html>
|
||
<html>
|
||
<!-- Created by GNU Texinfo 7.1, https://www.gnu.org/software/texinfo/ -->
|
||
<head>
|
||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||
<!-- Copyright (C) 2020-2025 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.
|
||
-->
|
||
<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">
|
||
<meta name="viewport" content="width=device-width,initial-scale=1">
|
||
|
||
<link href="#Top" rel="start" title="Top">
|
||
<link href="#Keystroke-Index" rel="index" title="Keystroke Index">
|
||
<link href="#Introduction" rel="next" title="Introduction">
|
||
<style type="text/css">
|
||
<!--
|
||
a.copiable-link {visibility: hidden; text-decoration: none; line-height: 0em}
|
||
div.example {margin-left: 3.2em}
|
||
span:hover a.copiable-link {visibility: visible}
|
||
ul.mark-bullet {list-style-type: disc}
|
||
-->
|
||
</style>
|
||
<link rel="stylesheet" type="text/css" href="assets/page.css">
|
||
|
||
|
||
</head>
|
||
|
||
<body lang="en">
|
||
|
||
|
||
|
||
|
||
<div class="top-level-extent" id="Top">
|
||
<div class="nav-panel">
|
||
<p>
|
||
Next: <a href="#Introduction" accesskey="n" rel="next">Introduction</a> [<a href="#Keystroke-Index" title="Index" rel="index">Index</a>]</p>
|
||
</div>
|
||
<h1 class="top" id="Org_002droam-User-Manual"><span>Org-roam User Manual<a class="copiable-link" href="#Org_002droam-User-Manual"> ¶</a></span></h1>
|
||
|
||
|
||
<p>This manual is for Org-roam version 2.3.1.
|
||
</p>
|
||
<blockquote class="quotation">
|
||
<p>Copyright (C) 2020-2025 Jethro Kuan <jethrokuan95@gmail.com>
|
||
</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>
|
||
|
||
|
||
|
||
<ul class="mini-toc">
|
||
<li><a href="#Introduction" accesskey="1">Introduction</a></li>
|
||
<li><a href="#Target-Audience" accesskey="2">Target Audience</a></li>
|
||
<li><a href="#A-Brief-Introduction-to-the-Zettelkasten-Method" accesskey="3">A Brief Introduction to the Zettelkasten Method</a></li>
|
||
<li><a href="#Installation" accesskey="4">Installation</a></li>
|
||
<li><a href="#Getting-Started" accesskey="5">Getting Started</a></li>
|
||
<li><a href="#Customizing-Node-Caching" accesskey="6">Customizing Node Caching</a></li>
|
||
<li><a href="#The-Org_002droam-Buffer" accesskey="7">The Org-roam Buffer</a></li>
|
||
<li><a href="#Node-Properties" accesskey="8">Node Properties</a></li>
|
||
<li><a href="#Citations" accesskey="9">Citations</a></li>
|
||
<li><a href="#Completion">Completion</a></li>
|
||
<li><a href="#Encryption">Encryption</a></li>
|
||
<li><a href="#The-Templating-System">The Templating System</a></li>
|
||
<li><a href="#Extensions">Extensions</a></li>
|
||
<li><a href="#Performance-Optimization">Performance Optimization</a></li>
|
||
<li><a href="#The-Org_002dmode-Ecosystem">The Org-mode Ecosystem</a></li>
|
||
<li><a href="#FAQ">FAQ</a></li>
|
||
<li><a href="#Developer_0027s-Guide-to-Org_002droam">Developer’s Guide to Org-roam</a></li>
|
||
<li><a href="#Appendix">Appendix</a></li>
|
||
<li><a href="#Keystroke-Index">Keystroke Index</a></li>
|
||
<li><a href="#Command-Index">Command Index</a></li>
|
||
<li><a href="#Function-Index">Function Index</a></li>
|
||
<li><a href="#Variable-Index">Variable Index</a></li>
|
||
</ul>
|
||
<hr>
|
||
<div class="chapter-level-extent" id="Introduction">
|
||
<div class="nav-panel">
|
||
<p>
|
||
Next: <a href="#Target-Audience" accesskey="n" rel="next">Target Audience</a>, Previous: <a href="#Top" accesskey="p" rel="prev">Org-roam User Manual</a>, Up: <a href="#Top" accesskey="u" rel="up">Org-roam User Manual</a> [<a href="#Keystroke-Index" title="Index" rel="index">Index</a>]</p>
|
||
</div>
|
||
<h2 class="chapter" id="Introduction-1"><span>1 Introduction<a class="copiable-link" href="#Introduction-1"> ¶</a></span></h2>
|
||
|
||
<p>Org-roam is a tool for networked thought. It reproduces some of <a class="uref" href="https://roamresearch.com/">Roam
|
||
Research’s</a> <a class="footnote" id="DOCF1" href="#FOOT1"><sup>1</sup></a> key features within <a class="uref" 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 class="uref" href="https://github.com/jkitchin/org-ref">org-ref</a> for citation management, and is able to
|
||
piggyback off Org’s excellent LaTeX and source-block evaluation capabilities.
|
||
</p>
|
||
<p>Org-roam provides these benefits over other tooling:
|
||
</p>
|
||
<ul class="itemize mark-bullet">
|
||
<li><strong class="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 class="strong">Longevity of Plain Text:</strong> Unlike web solutions like Roam Research, the notes
|
||
are first and foremost plain Org-mode files – 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 class="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 class="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 class="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>
|
||
</div>
|
||
<div class="chapter-level-extent" id="Target-Audience">
|
||
<div class="nav-panel">
|
||
<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">Org-roam User Manual</a> [<a href="#Keystroke-Index" title="Index" rel="index">Index</a>]</p>
|
||
</div>
|
||
<h2 class="chapter" id="Target-Audience-1"><span>2 Target Audience<a class="copiable-link" href="#Target-Audience-1"> ¶</a></span></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
|
||
in 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’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 class="quotation">
|
||
<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>
|
||
</div>
|
||
<div class="chapter-level-extent" id="A-Brief-Introduction-to-the-Zettelkasten-Method">
|
||
<div class="nav-panel">
|
||
<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">Org-roam User Manual</a> [<a href="#Keystroke-Index" title="Index" rel="index">Index</a>]</p>
|
||
</div>
|
||
<h2 class="chapter" id="A-Brief-Introduction-to-the-Zettelkasten-Method-1"><span>3 A Brief Introduction to the Zettelkasten Method<a class="copiable-link" href="#A-Brief-Introduction-to-the-Zettelkasten-Method-1"> ¶</a></span></h2>
|
||
|
||
<p>Org-roam provides utilities for maintaining a digital slip-box. This section
|
||
aims to provide a brief introduction to the “slip-box”, or “Zettelkasten”
|
||
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’s slip-box was simply a
|
||
box of cards. These cards are small – 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 class="strong">Fleeting notes</strong>
|
||
</p>
|
||
<p>A slip-box requires a method for quickly capturing ideas. These are called
|
||
<strong class="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 class="code">org-capture</code> (see <a data-manual="org" href="https://www.gnu.org/software/emacs/manual/html_mono/org.html#Capture">(org)Capture</a>), or using Org-roam’s daily notes
|
||
functionality (see <a class="ref" href="#org_002droam_002ddailies">org-roam-dailies</a>). This provides a central inbox for collecting
|
||
thoughts, to be processed later into permanent notes.
|
||
</p>
|
||
<p><strong class="strong">Permanent notes</strong>
|
||
</p>
|
||
<p>Permanent notes are further split into two categories: <strong class="strong">literature notes</strong> and
|
||
<strong class="strong">concept notes</strong>. Literature notes can be brief annotations on a particular
|
||
source (e.g. book, website or paper), that you’d like to access later on.
|
||
Concept notes require much more care in authoring: they need to be
|
||
self-explanatory and detailed. Org-roam’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, “How to Take Smart Notes” by
|
||
Sonke Ahrens is a decent guide.
|
||
</p>
|
||
<hr>
|
||
</div>
|
||
<div class="chapter-level-extent" id="Installation">
|
||
<div class="nav-panel">
|
||
<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">Org-roam User Manual</a> [<a href="#Keystroke-Index" title="Index" rel="index">Index</a>]</p>
|
||
</div>
|
||
<h2 class="chapter" id="Installation-1"><span>4 Installation<a class="copiable-link" href="#Installation-1"> ¶</a></span></h2>
|
||
|
||
<p>Org-roam can be installed using Emacs’ package manager or manually from its
|
||
development repository.
|
||
</p>
|
||
|
||
<ul class="mini-toc">
|
||
<li><a href="#Installing-from-MELPA" accesskey="1">Installing from MELPA</a></li>
|
||
<li><a href="#Installing-from-Source" accesskey="2">Installing from Source</a></li>
|
||
</ul>
|
||
<hr>
|
||
<div class="section-level-extent" id="Installing-from-MELPA">
|
||
<div class="nav-panel">
|
||
<p>
|
||
Next: <a href="#Installing-from-Source" accesskey="n" rel="next">Installing from Source</a>, Up: <a href="#Installation" accesskey="u" rel="up">Installation</a> [<a href="#Keystroke-Index" title="Index" rel="index">Index</a>]</p>
|
||
</div>
|
||
<h3 class="section" id="Installing-from-MELPA-1"><span>4.1 Installing from MELPA<a class="copiable-link" href="#Installing-from-MELPA-1"> ¶</a></span></h3>
|
||
|
||
<p>Org-roam is available from Melpa and Melpa-Stable. If you haven’t used Emacs’
|
||
package manager before, you may familiarize yourself with it by reading the
|
||
documentation in the Emacs manual, see <a data-manual="emacs" href="https://www.gnu.org/software/emacs/manual/html_mono/emacs.html#Packages">(emacs)Packages</a>. Then, add one of the
|
||
archives to ‘<samp class="samp">package-archives</samp>’:
|
||
</p>
|
||
<ul class="itemize mark-bullet">
|
||
<li>To use Melpa:
|
||
</li></ul>
|
||
|
||
<div class="example lisp">
|
||
<pre class="lisp-preformatted">(require 'package)
|
||
(add-to-list 'package-archives
|
||
'("melpa" . "http://melpa.org/packages/") t)
|
||
</pre></div>
|
||
|
||
<ul class="itemize mark-bullet">
|
||
<li>To use Melpa-Stable:
|
||
</li></ul>
|
||
|
||
<div class="example lisp">
|
||
<pre class="lisp-preformatted">(require 'package)
|
||
(add-to-list 'package-archives
|
||
'("melpa-stable" . "http://stable.melpa.org/packages/") t)
|
||
</pre></div>
|
||
|
||
<p>Org-roam also depends on a recent version of Org, which can be obtained in Org’s
|
||
package repository (see <a data-manual="org" href="https://www.gnu.org/software/emacs/manual/html_mono/org.html#Installation">(org)Installation</a>).
|
||
</p>
|
||
<p>Once you have done that, you can install Org-roam and its dependencies
|
||
using:
|
||
</p>
|
||
<div class="example">
|
||
<pre class="example-preformatted">M-x package-install RET org-roam RET
|
||
</pre></div>
|
||
|
||
<hr>
|
||
</div>
|
||
<div class="section-level-extent" id="Installing-from-Source">
|
||
<div class="nav-panel">
|
||
<p>
|
||
Previous: <a href="#Installing-from-MELPA" accesskey="p" rel="prev">Installing from MELPA</a>, Up: <a href="#Installation" accesskey="u" rel="up">Installation</a> [<a href="#Keystroke-Index" title="Index" rel="index">Index</a>]</p>
|
||
</div>
|
||
<h3 class="section" id="Installing-from-Source-1"><span>4.2 Installing from Source<a class="copiable-link" href="#Installing-from-Source-1"> ¶</a></span></h3>
|
||
|
||
<p>You may install Org-roam directly from the repository on <a class="uref" 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’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-preformatted">git clone https://github.com/org-roam/org-roam.git /path/to/org/roam
|
||
</pre></div>
|
||
|
||
<p>where <code class="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 class="code">require</code> the
|
||
Org-roam library. Add the following code to your <code class="code">.emacs</code>:
|
||
</p>
|
||
<div class="example lisp">
|
||
<pre class="lisp-preformatted">(add-to-list 'load-path "/path/to/org/roam")
|
||
(require 'org-roam)
|
||
</pre></div>
|
||
|
||
<p>You now have Org-roam installed. However, you don’t necessarily have the
|
||
dependencies that it requires. These include:
|
||
</p>
|
||
<ul class="itemize mark-bullet">
|
||
<li>dash
|
||
</li><li>f
|
||
</li><li>s
|
||
</li><li>org
|
||
</li><li>emacsql
|
||
</li><li>magit-section
|
||
</li></ul>
|
||
|
||
<p>You can install this manually as well, or get the latest version from MELPA. You
|
||
may wish to use <a class="uref" href="https://github.com/jwiegley/use-package">use-package</a>, <a class="uref" 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’ built-in Info
|
||
system, you’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 class="code">/doc</code>
|
||
subdirectory of the Org-roam repository, and run the following:
|
||
</p>
|
||
<div class="example">
|
||
<pre class="example-preformatted">make infodir=/path/to/my/info/files install-info
|
||
</pre></div>
|
||
|
||
<p>Where <code class="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
|
||
‘Info-default-directory-list‘. If you aren’t using one of the default info
|
||
locations, you can configure this with the following in your <code class="code">.emacs</code> file:
|
||
</p>
|
||
<div class="example lisp">
|
||
<pre class="lisp-preformatted">(require 'info)
|
||
(add-to-list 'Info-default-directory-list
|
||
"/path/to/my/info/files")
|
||
</pre></div>
|
||
|
||
<p>You can also use one of the default locations, such as:
|
||
</p>
|
||
<ul class="itemize mark-bullet">
|
||
<li><em class="emph">usr/local/share/info</em>
|
||
</li><li><em class="emph">usr/share/info</em>
|
||
</li><li><em class="emph">usr/local/share/info</em>
|
||
</li></ul>
|
||
|
||
<p>If you do this, you’ll need to make sure you have write-access to that location,
|
||
or run the above <code class="code">make</code> command as root.
|
||
</p>
|
||
<p>Now that the info file is ready, you need to add it to the corresponding <code class="code">dir</code>
|
||
file:
|
||
</p>
|
||
<div class="example">
|
||
<pre class="example-preformatted">install-info /path/to/my/info/files/org-roam.info /path/to/my/info/files/dir
|
||
</pre></div>
|
||
|
||
<hr>
|
||
</div>
|
||
</div>
|
||
<div class="chapter-level-extent" id="Getting-Started">
|
||
<div class="nav-panel">
|
||
<p>
|
||
Next: <a href="#Customizing-Node-Caching" accesskey="n" rel="next">Customizing Node Caching</a>, Previous: <a href="#Installation" accesskey="p" rel="prev">Installation</a>, Up: <a href="#Top" accesskey="u" rel="up">Org-roam User Manual</a> [<a href="#Keystroke-Index" title="Index" rel="index">Index</a>]</p>
|
||
</div>
|
||
<h2 class="chapter" id="Getting-Started-1"><span>5 Getting Started<a class="copiable-link" href="#Getting-Started-1"> ¶</a></span></h2>
|
||
|
||
|
||
<ul class="mini-toc">
|
||
<li><a href="#The-Org_002droam-Node" accesskey="1">The Org-roam Node</a></li>
|
||
<li><a href="#Links-between-Nodes" accesskey="2">Links between Nodes</a></li>
|
||
<li><a href="#Setting-up-Org_002droam" accesskey="3">Setting up Org-roam</a></li>
|
||
<li><a href="#Creating-and-Linking-Nodes" accesskey="4">Creating and Linking Nodes</a></li>
|
||
<li><a href="#Customizing-Node-Completions" accesskey="5">Customizing Node Completions</a></li>
|
||
</ul>
|
||
<hr>
|
||
<div class="section-level-extent" id="The-Org_002droam-Node">
|
||
<div class="nav-panel">
|
||
<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> [<a href="#Keystroke-Index" title="Index" rel="index">Index</a>]</p>
|
||
</div>
|
||
<h3 class="section" id="The-Org_002droam-Node-1"><span>5.1 The Org-roam Node<a class="copiable-link" href="#The-Org_002droam-Node-1"> ¶</a></span></h3>
|
||
|
||
<p>We first begin with some terminology we’ll use throughout the manual. We term
|
||
the basic denomination in Org-roam a node. We define a node as follows:
|
||
</p>
|
||
<blockquote class="quotation">
|
||
<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-preformatted">:PROPERTIES:
|
||
:ID: foo
|
||
:END:
|
||
#+title: Foo
|
||
|
||
* Bar
|
||
:PROPERTIES:
|
||
:ID: bar
|
||
:END:
|
||
</pre></div>
|
||
|
||
<p>We create two nodes:
|
||
</p>
|
||
<ol class="enumerate">
|
||
<li> A file node “Foo” with id <code class="code">foo</code>.
|
||
</li><li> A headline node “Bar” with id <code class="code">bar</code>.
|
||
</li></ol>
|
||
|
||
<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 class="code">M-x org-id-get-create</code>.
|
||
</p>
|
||
<hr>
|
||
</div>
|
||
<div class="section-level-extent" id="Links-between-Nodes">
|
||
<div class="nav-panel">
|
||
<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> [<a href="#Keystroke-Index" title="Index" rel="index">Index</a>]</p>
|
||
</div>
|
||
<h3 class="section" id="Links-between-Nodes-1"><span>5.2 Links between Nodes<a class="copiable-link" href="#Links-between-Nodes-1"> ¶</a></span></h3>
|
||
|
||
<p>We link between nodes using Org’s standard ID link (e.g. <code class="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>
|
||
</div>
|
||
<div class="section-level-extent" id="Setting-up-Org_002droam">
|
||
<div class="nav-panel">
|
||
<p>
|
||
Next: <a href="#Creating-and-Linking-Nodes" accesskey="n" rel="next">Creating and Linking Nodes</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> [<a href="#Keystroke-Index" title="Index" rel="index">Index</a>]</p>
|
||
</div>
|
||
<h3 class="section" id="Setting-up-Org_002droam-1"><span>5.3 Setting up Org-roam<a class="copiable-link" href="#Setting-up-Org_002droam-1"> ¶</a></span></h3>
|
||
|
||
<p>Org-roam’s capabilities stem from its aggressive caching: it crawls all files
|
||
within <code class="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 class="code">org-roam-directory</code>. Org-roam searches recursively within <code class="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 class="code">org-roam-directory</code>:
|
||
</p>
|
||
<div class="example lisp">
|
||
<pre class="lisp-preformatted">(make-directory "~/org-roam")
|
||
(setq org-roam-directory (file-truename "~/org-roam"))
|
||
</pre></div>
|
||
|
||
<p>The <code class="code">file-truename</code> function is only necessary when you use symbolic links
|
||
inside <code class="code">org-roam-directory</code>: Org-roam does not resolve symbolic links. One can
|
||
however instruct Emacs to always resolve symlinks, at a performance cost:
|
||
</p>
|
||
<div class="example lisp">
|
||
<pre class="lisp-preformatted">(setq find-file-visit-truename t)
|
||
</pre></div>
|
||
|
||
<p>Next, we setup Org-roam to run functions on file changes to maintain cache
|
||
consistency. This is achieved by running <code class="code">M-x org-roam-db-autosync-mode</code>. To
|
||
ensure that Org-roam is available on startup, place this in your Emacs
|
||
configuration:
|
||
</p>
|
||
<div class="example lisp">
|
||
<pre class="lisp-preformatted">(org-roam-db-autosync-mode)
|
||
</pre></div>
|
||
|
||
<p>To build the cache manually, run <code class="code">M-x org-roam-db-sync</code>. Cache builds may
|
||
take a while the first time, but subsequent builds are often instantaneous
|
||
because they only reprocess modified files.
|
||
</p>
|
||
<hr>
|
||
</div>
|
||
<div class="section-level-extent" id="Creating-and-Linking-Nodes">
|
||
<div class="nav-panel">
|
||
<p>
|
||
Next: <a href="#Customizing-Node-Completions" accesskey="n" rel="next">Customizing Node Completions</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> [<a href="#Keystroke-Index" title="Index" rel="index">Index</a>]</p>
|
||
</div>
|
||
<h3 class="section" id="Creating-and-Linking-Nodes-1"><span>5.4 Creating and Linking Nodes<a class="copiable-link" href="#Creating-and-Linking-Nodes-1"> ¶</a></span></h3>
|
||
|
||
<p>Org-roam makes it easy to create notes and link them together. There are 2 main
|
||
functions for creating nodes:
|
||
</p>
|
||
<ul class="itemize mark-bullet">
|
||
<li><code class="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 class="code">org-roam-node-find</code>: creates a node if it does not exist, and visits the
|
||
node.
|
||
</li><li><code class="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’s first try <code class="code">org-roam-node-find</code>. Calling <code class="code">M-x org-roam-node-find</code> will
|
||
show a list of titles for nodes that reside in <code class="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 class="code">RET</code>. This begins the note
|
||
creation process. This process uses <code class="code">org-capture</code>’s templating system, and can
|
||
be customized (see <a class="ref" href="#The-Templating-System">The Templating System</a>). Using the default template, pressing
|
||
<code class="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 class="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 class="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 class="ref" href="#Completion">Completion</a>).
|
||
</p>
|
||
<hr>
|
||
</div>
|
||
<div class="section-level-extent" id="Customizing-Node-Completions">
|
||
<div class="nav-panel">
|
||
<p>
|
||
Previous: <a href="#Creating-and-Linking-Nodes" accesskey="p" rel="prev">Creating and Linking Nodes</a>, Up: <a href="#Getting-Started" accesskey="u" rel="up">Getting Started</a> [<a href="#Keystroke-Index" title="Index" rel="index">Index</a>]</p>
|
||
</div>
|
||
<h3 class="section" id="Customizing-Node-Completions-1"><span>5.5 Customizing Node Completions<a class="copiable-link" href="#Customizing-Node-Completions-1"> ¶</a></span></h3>
|
||
|
||
<p>Node selection is achieved via the <code class="code">completing-read</code> interface, typically
|
||
through <code class="code">org-roam-node-read</code>. The presentation of these nodes are governed by
|
||
<code class="code">org-roam-node-display-template</code>.
|
||
</p>
|
||
<ul class="itemize mark-bullet">
|
||
<li>Variable: org-roam-node-display-template
|
||
|
||
<p>Configures display formatting for Org-roam node.
|
||
</p>
|
||
<p>Patterns of form “${field-name:length}” are interpolated based
|
||
on the current node.
|
||
</p>
|
||
<p>Each “field-name” is replaced with the return value of each
|
||
corresponding accessor function for org-roam-node, e.g.
|
||
“${title}” will be interpolated by the result of
|
||
org-roam-node-title. You can also define custom accessors using
|
||
cl-defmethod. For example, you can define:
|
||
</p>
|
||
<p>(cl-defmethod org-roam-node-my-title ((node org-roam-node))
|
||
(concat “My ” (org-roam-node-title node)))
|
||
</p>
|
||
<p>and then reference it here or in the capture templates as
|
||
“${my-title}”.
|
||
</p>
|
||
<p>“length” is an optional specifier and declares how many
|
||
characters can be used to display the value of the corresponding
|
||
field. If it’s not specified, the field will be inserted as is,
|
||
i.e. it won’t be aligned nor trimmed. If it’s an integer, the
|
||
field will be aligned accordingly and all the exceeding
|
||
characters will be trimmed out. If it’s “*”, the field will use
|
||
as many characters as possible and will be aligned accordingly.
|
||
</p>
|
||
<p>A closure can also be assigned to this variable in which case the
|
||
closure is evaluated and the return value is used as the
|
||
template. The closure must evaluate to a valid template string.
|
||
</p></li></ul>
|
||
|
||
<p>If you’re using a vertical completion framework, such as Ivy and Selectrum,
|
||
Org-roam supports the generation of an aligned, tabular completion interface.
|
||
For example, to include a column for tags up to 10 character widths wide, one
|
||
can set <code class="code">org-roam-node-display-template</code> as such:
|
||
</p>
|
||
<div class="example lisp">
|
||
<pre class="lisp-preformatted">(setq org-roam-node-display-template
|
||
(concat "${title:*} "
|
||
(propertize "${tags:10}" 'face 'org-tag)))
|
||
</pre></div>
|
||
|
||
<hr>
|
||
</div>
|
||
</div>
|
||
<div class="chapter-level-extent" id="Customizing-Node-Caching">
|
||
<div class="nav-panel">
|
||
<p>
|
||
Next: <a href="#The-Org_002droam-Buffer" accesskey="n" rel="next">The Org-roam Buffer</a>, Previous: <a href="#Getting-Started" accesskey="p" rel="prev">Getting Started</a>, Up: <a href="#Top" accesskey="u" rel="up">Org-roam User Manual</a> [<a href="#Keystroke-Index" title="Index" rel="index">Index</a>]</p>
|
||
</div>
|
||
<h2 class="chapter" id="Customizing-Node-Caching-1"><span>6 Customizing Node Caching<a class="copiable-link" href="#Customizing-Node-Caching-1"> ¶</a></span></h2>
|
||
|
||
|
||
<ul class="mini-toc">
|
||
<li><a href="#How-to-cache" accesskey="1">How to cache</a></li>
|
||
<li><a href="#What-to-cache" accesskey="2">What to cache</a></li>
|
||
<li><a href="#When-to-cache" accesskey="3">When to cache</a></li>
|
||
</ul>
|
||
<hr>
|
||
<div class="section-level-extent" id="How-to-cache">
|
||
<div class="nav-panel">
|
||
<p>
|
||
Next: <a href="#What-to-cache" accesskey="n" rel="next">What to cache</a>, Up: <a href="#Customizing-Node-Caching" accesskey="u" rel="up">Customizing Node Caching</a> [<a href="#Keystroke-Index" title="Index" rel="index">Index</a>]</p>
|
||
</div>
|
||
<h3 class="section" id="How-to-cache-1"><span>6.1 How to cache<a class="copiable-link" href="#How-to-cache-1"> ¶</a></span></h3>
|
||
|
||
<p>Org-roam uses a SQLite database to perform caching. This integration is
|
||
managed by the <a class="uref" href="https://github.com/magit/emacsql">emacsql</a> library. It should “just work”.
|
||
</p>
|
||
<hr>
|
||
</div>
|
||
<div class="section-level-extent" id="What-to-cache">
|
||
<div class="nav-panel">
|
||
<p>
|
||
Next: <a href="#When-to-cache" accesskey="n" rel="next">When to cache</a>, Previous: <a href="#How-to-cache" accesskey="p" rel="prev">How to cache</a>, Up: <a href="#Customizing-Node-Caching" accesskey="u" rel="up">Customizing Node Caching</a> [<a href="#Keystroke-Index" title="Index" rel="index">Index</a>]</p>
|
||
</div>
|
||
<h3 class="section" id="What-to-cache-1"><span>6.2 What to cache<a class="copiable-link" href="#What-to-cache-1"> ¶</a></span></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 class="code">ROAM_EXCLUDE</code>
|
||
property to a non-nil value. For example:
|
||
</p>
|
||
<div class="example">
|
||
<pre class="example-preformatted">* Foo
|
||
:PROPERTIES:
|
||
:ID: foo
|
||
:ROAM_EXCLUDE: t
|
||
:END:
|
||
</pre></div>
|
||
|
||
<p>One can also set <code class="code">org-roam-db-node-include-function</code>. For example, to exclude
|
||
all headlines with the <code class="code">ATTACH</code> tag from the Org-roam database, one can set:
|
||
</p>
|
||
<div class="example lisp">
|
||
<pre class="lisp-preformatted">(setq org-roam-db-node-include-function
|
||
(lambda ()
|
||
(not (member "ATTACH" (org-get-tags)))))
|
||
</pre></div>
|
||
|
||
<p>Org-roam relied on the obtained Org AST for the buffer to parse links. However,
|
||
links appearing in some places (e.g. within property drawers) are not considered
|
||
by the Org AST to be links. Therefore, Org-roam takes special care of
|
||
additionally trying to process these links. Use
|
||
<code class="code">org-roam-db-extra-links-elements</code> to specify which additional Org AST element
|
||
types to consider.
|
||
</p>
|
||
<ul class="itemize mark-bullet">
|
||
<li>Variable: org-roam-db-extra-links-elements
|
||
|
||
<p>The list of Org element types to include for parsing by Org-roam.
|
||
</p>
|
||
<p>By default, when parsing Org’s AST, links within keywords and
|
||
property drawers are not parsed as links. Sometimes however, it
|
||
is desirable to parse and cache these links (e.g. hiding links in
|
||
a property drawer).
|
||
</p></li></ul>
|
||
|
||
<p>Additionally, one may want to ignore certain keys from being excluded within
|
||
property drawers. For example, we would not want <code class="code">ROAM_REFS</code> links to be
|
||
self-referential. Hence, to exclude specific keys, we use
|
||
<code class="code">org-roam-db-extra-links-exclude-keys</code>.
|
||
</p>
|
||
<ul class="itemize mark-bullet">
|
||
<li>Variable: org-roam-db-extra-links-exclude-keys
|
||
|
||
<p>Keys to ignore when mapping over links.
|
||
</p>
|
||
<p>The car of the association list is the Org element type (e.g. keyword). The
|
||
cdr is a list of case-insensitive strings to exclude from being treated as
|
||
links.
|
||
</p></li></ul>
|
||
|
||
<hr>
|
||
</div>
|
||
<div class="section-level-extent" id="When-to-cache">
|
||
<div class="nav-panel">
|
||
<p>
|
||
Previous: <a href="#What-to-cache" accesskey="p" rel="prev">What to cache</a>, Up: <a href="#Customizing-Node-Caching" accesskey="u" rel="up">Customizing Node Caching</a> [<a href="#Keystroke-Index" title="Index" rel="index">Index</a>]</p>
|
||
</div>
|
||
<h3 class="section" id="When-to-cache-1"><span>6.3 When to cache<a class="copiable-link" href="#When-to-cache-1"> ¶</a></span></h3>
|
||
|
||
<p>By default, Org-roam is eager in caching: each time an Org-roam file is modified
|
||
and saved, it updates the database for the corresponding file. This keeps the
|
||
database up-to-date, causing the least surprise when using the interactive
|
||
commands.
|
||
</p>
|
||
<p>However, depending on how large your Org files are, database updating can be a
|
||
slow operation. You can disable the automatic updating of the database by
|
||
setting <code class="code">org-roam-db-update-on-save</code> to <code class="code">nil</code>.
|
||
</p>
|
||
<ul class="itemize mark-bullet">
|
||
<li>Variable: org-roam-db-update-on-save
|
||
</li></ul>
|
||
|
||
<p>If t, update the Org-roam database upon saving the file. Disable this if your
|
||
files are large and updating the database is slow.
|
||
</p>
|
||
<hr>
|
||
</div>
|
||
</div>
|
||
<div class="chapter-level-extent" id="The-Org_002droam-Buffer">
|
||
<div class="nav-panel">
|
||
<p>
|
||
Next: <a href="#Node-Properties" accesskey="n" rel="next">Node Properties</a>, Previous: <a href="#Customizing-Node-Caching" accesskey="p" rel="prev">Customizing Node Caching</a>, Up: <a href="#Top" accesskey="u" rel="up">Org-roam User Manual</a> [<a href="#Keystroke-Index" title="Index" rel="index">Index</a>]</p>
|
||
</div>
|
||
<h2 class="chapter" id="The-Org_002droam-Buffer-1"><span>7 The Org-roam Buffer<a class="copiable-link" href="#The-Org_002droam-Buffer-1"> ¶</a></span></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 commands to use here:
|
||
</p>
|
||
<ul class="itemize mark-bullet">
|
||
<li><code class="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><li><code class="code">org-roam-buffer-display-dedicated</code>: Launch an Org-roam buffer for a specific
|
||
node without visiting its file. Unlike <code class="code">org-roam-buffer-toggle</code> you can have
|
||
multiple such buffers and their content won’t be automatically replaced with a
|
||
new node at point.
|
||
</li></ul>
|
||
|
||
<p>To bring up a buffer that tracks the current node at point, call <code class="code">M-x
|
||
org-roam-buffer-toggle</code>.
|
||
</p>
|
||
<ul class="itemize mark-bullet">
|
||
<li>Function: org-roam-buffer-toggle
|
||
|
||
<p>Toggle display of the <code class="code">org-roam-buffer</code>.
|
||
</p></li></ul>
|
||
|
||
<p>To bring up a buffer that’s dedicated for a specific node, call <code class="code">M-x
|
||
org-roam-buffer-display-dedicated</code>.
|
||
</p>
|
||
<ul class="itemize mark-bullet">
|
||
<li>Function: org-roam-buffer-display-dedicated
|
||
|
||
<p>Launch node dedicated Org-roam buffer without visiting the node itself.
|
||
</p></li></ul>
|
||
|
||
|
||
<ul class="mini-toc">
|
||
<li><a href="#Navigating-the-Org_002droam-Buffer" accesskey="1">Navigating the Org-roam Buffer</a></li>
|
||
<li><a href="#Configuring-what-is-displayed-in-the-buffer" accesskey="2">Configuring what is displayed in the buffer</a></li>
|
||
<li><a href="#Configuring-the-Org_002droam-buffer-display" accesskey="3">Configuring the Org-roam buffer display</a></li>
|
||
<li><a href="#Styling-the-Org_002droam-buffer" accesskey="4"><strong class="strong">TODO</strong> Styling the Org-roam buffer</a></li>
|
||
</ul>
|
||
<hr>
|
||
<div class="section-level-extent" id="Navigating-the-Org_002droam-Buffer">
|
||
<div class="nav-panel">
|
||
<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> [<a href="#Keystroke-Index" title="Index" rel="index">Index</a>]</p>
|
||
</div>
|
||
<h3 class="section" id="Navigating-the-Org_002droam-Buffer-1"><span>7.1 Navigating the Org-roam Buffer<a class="copiable-link" href="#Navigating-the-Org_002droam-Buffer-1"> ¶</a></span></h3>
|
||
|
||
<p>The Org-roam buffer uses <code class="code">magit-section</code>, making the typical <code class="code">magit-section</code>
|
||
keybindings available. Here are several of the more useful ones:
|
||
</p>
|
||
<ul class="itemize mark-bullet">
|
||
<li><code class="code">M-{N}</code>: <code class="code">magit-section-show-level-{N}-all</code>
|
||
</li><li><code class="code">n</code>: <code class="code">magit-section-forward</code>
|
||
</li><li><code class="code"><TAB></code>: <code class="code">magit-section-toggle</code>
|
||
</li><li><code class="code"><RET></code>: <code class="code">org-roam-buffer-visit-thing</code>
|
||
</li></ul>
|
||
|
||
<p><code class="code">org-roam-buffer-visit-thing</code> is a placeholder command, that is replaced by
|
||
section-specific commands such as <code class="code">org-roam-node-visit</code>.
|
||
</p>
|
||
<hr>
|
||
</div>
|
||
<div class="section-level-extent" id="Configuring-what-is-displayed-in-the-buffer">
|
||
<div class="nav-panel">
|
||
<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> [<a href="#Keystroke-Index" title="Index" rel="index">Index</a>]</p>
|
||
</div>
|
||
<h3 class="section" id="Configuring-what-is-displayed-in-the-buffer-1"><span>7.2 Configuring what is displayed in the buffer<a class="copiable-link" href="#Configuring-what-is-displayed-in-the-buffer-1"> ¶</a></span></h3>
|
||
|
||
<p>There are currently 3 provided widget types:
|
||
</p>
|
||
<dl class="table">
|
||
<dt>Backlinks</dt>
|
||
<dd><p>View (preview of) nodes that link to this node
|
||
</p></dd>
|
||
<dt>Reference Links</dt>
|
||
<dd><p>Nodes that reference this node (see <a class="ref" href="#Refs">Refs</a>)
|
||
</p></dd>
|
||
<dt>Unlinked references</dt>
|
||
<dd><p>View nodes that contain text that match the nodes
|
||
title/alias but are not linked
|
||
</p></dd>
|
||
</dl>
|
||
|
||
<p>To configure what sections are displayed in the buffer, set <code class="code">org-roam-mode-sections</code>.
|
||
</p>
|
||
<div class="example lisp">
|
||
<pre class="lisp-preformatted">(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>
|
||
<p>For each section function, you can pass args along to modify its behaviour. For
|
||
example, if you want to render unique sources for backlinks (and also keep
|
||
rendering reference links), set <code class="code">org-roam-mode-sections</code> as follows:
|
||
</p>
|
||
<div class="example lisp">
|
||
<pre class="lisp-preformatted">(setq org-roam-mode-sections
|
||
'((org-roam-backlinks-section :unique t)
|
||
org-roam-reflinks-section))
|
||
</pre></div>
|
||
|
||
<p>The backlinks section <code class="code">org-roam-backlinks-section</code> also supports a
|
||
predicate to filter backlinks, <code class="code">:show-backlink-p</code>. This can be used
|
||
as follows:
|
||
</p>
|
||
<div class="example lisp">
|
||
<pre class="lisp-preformatted">(defun my-org-roam-show-backlink-p (backlink)
|
||
(not (member "daily" (org-roam-node-tags (org-roam-backlink-source-node backlink)))))
|
||
|
||
(setq org-roam-mode-sections
|
||
'((org-roam-backlinks-section :unique t :show-backlink-p my-org-roam-show-backlink-p)
|
||
org-roam-reflinks-section))
|
||
</pre></div>
|
||
|
||
<hr>
|
||
</div>
|
||
<div class="section-level-extent" id="Configuring-the-Org_002droam-buffer-display">
|
||
<div class="nav-panel">
|
||
<p>
|
||
Next: <a href="#Styling-the-Org_002droam-buffer" accesskey="n" rel="next"><strong class="strong">TODO</strong> 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> [<a href="#Keystroke-Index" title="Index" rel="index">Index</a>]</p>
|
||
</div>
|
||
<h3 class="section" id="Configuring-the-Org_002droam-buffer-display-1"><span>7.3 Configuring the Org-roam buffer display<a class="copiable-link" href="#Configuring-the-Org_002droam-buffer-display-1"> ¶</a></span></h3>
|
||
|
||
<p>Org-roam does not control how the pop-up buffer is displayed: this is left to
|
||
the user. The author’s recommended configuration is as follows:
|
||
</p>
|
||
<div class="example lisp">
|
||
<pre class="lisp-preformatted">(add-to-list 'display-buffer-alist
|
||
'("\\*org-roam\\*"
|
||
(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 class="itemize mark-bullet">
|
||
<li><code class="code">RET</code> navigates to thing-at-point in the current window, replacing the
|
||
Org-roam buffer.
|
||
</li><li><code class="code">C-u RET</code> navigates to thing-at-point in the other window.
|
||
</li></ul>
|
||
|
||
<p>For users that prefer using a side-window for the org-roam buffer, the following
|
||
example configuration should provide a good starting point:
|
||
</p>
|
||
<div class="example lisp">
|
||
<pre class="lisp-preformatted">(add-to-list 'display-buffer-alist
|
||
'("\\*org-roam\\*"
|
||
(display-buffer-in-side-window)
|
||
(side . right)
|
||
(slot . 0)
|
||
(window-width . 0.33)
|
||
(window-parameters . ((no-other-window . t)
|
||
(no-delete-other-windows . t)))))
|
||
</pre></div>
|
||
|
||
<hr>
|
||
</div>
|
||
<div class="section-level-extent" id="Styling-the-Org_002droam-buffer">
|
||
<div class="nav-panel">
|
||
<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> [<a href="#Keystroke-Index" title="Index" rel="index">Index</a>]</p>
|
||
</div>
|
||
<h3 class="section" id="TODO-Styling-the-Org_002droam-buffer"><span>7.4 <strong class="strong">TODO</strong> Styling the Org-roam buffer<a class="copiable-link" href="#TODO-Styling-the-Org_002droam-buffer"> ¶</a></span></h3>
|
||
|
||
<hr>
|
||
</div>
|
||
</div>
|
||
<div class="chapter-level-extent" id="Node-Properties">
|
||
<div class="nav-panel">
|
||
<p>
|
||
Next: <a href="#Citations" accesskey="n" rel="next">Citations</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">Org-roam User Manual</a> [<a href="#Keystroke-Index" title="Index" rel="index">Index</a>]</p>
|
||
</div>
|
||
<h2 class="chapter" id="Node-Properties-1"><span>8 Node Properties<a class="copiable-link" href="#Node-Properties-1"> ¶</a></span></h2>
|
||
|
||
|
||
<ul class="mini-toc">
|
||
<li><a href="#Standard-Org-properties" accesskey="1">Standard Org properties</a></li>
|
||
<li><a href="#Titles-and-Aliases" accesskey="2">Titles and Aliases</a></li>
|
||
<li><a href="#Tags" accesskey="3">Tags</a></li>
|
||
<li><a href="#Refs" accesskey="4">Refs</a></li>
|
||
</ul>
|
||
<hr>
|
||
<div class="section-level-extent" id="Standard-Org-properties">
|
||
<div class="nav-panel">
|
||
<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> [<a href="#Keystroke-Index" title="Index" rel="index">Index</a>]</p>
|
||
</div>
|
||
<h3 class="section" id="Standard-Org-properties-1"><span>8.1 Standard Org properties<a class="copiable-link" href="#Standard-Org-properties-1"> ¶</a></span></h3>
|
||
|
||
<p>Org-roam caches most of the standard Org properties. The full list now includes:
|
||
</p>
|
||
<ul class="itemize mark-bullet">
|
||
<li>outline level
|
||
</li><li>todo state
|
||
</li><li>priority
|
||
</li><li>scheduled
|
||
</li><li>deadline
|
||
</li><li>tags
|
||
</li></ul>
|
||
|
||
<hr>
|
||
</div>
|
||
<div class="section-level-extent" id="Titles-and-Aliases">
|
||
<div class="nav-panel">
|
||
<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> [<a href="#Keystroke-Index" title="Index" rel="index">Index</a>]</p>
|
||
</div>
|
||
<h3 class="section" id="Titles-and-Aliases-1"><span>8.2 Titles and Aliases<a class="copiable-link" href="#Titles-and-Aliases-1"> ¶</a></span></h3>
|
||
|
||
<p>Each node has a single title. For file nodes, this is specified with the
|
||
‘#+title‘ 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 “Artificial Intelligence”.
|
||
</p>
|
||
<p>To assign an alias to a node, add the “ROAM<em class="math">_ALIASES</em>” property to the node:
|
||
</p>
|
||
<div class="example">
|
||
<pre class="example-preformatted">* Artificial Intelligence
|
||
:PROPERTIES:
|
||
:ROAM_ALIASES: AI
|
||
:END:
|
||
</pre></div>
|
||
|
||
<p>Alternatively, Org-roam provides some functions to add or remove aliases.
|
||
</p>
|
||
<ul class="itemize mark-bullet">
|
||
<li>Function: org-roam-alias-add alias
|
||
|
||
<p>Add ALIAS to the node at point. When called interactively, prompt for the
|
||
alias to add.
|
||
</p>
|
||
</li><li>Function: org-roam-alias-remove
|
||
|
||
<p>Remove an alias from the node at point.
|
||
</p></li></ul>
|
||
|
||
<hr>
|
||
</div>
|
||
<div class="section-level-extent" id="Tags">
|
||
<div class="nav-panel">
|
||
<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> [<a href="#Keystroke-Index" title="Index" rel="index">Index</a>]</p>
|
||
</div>
|
||
<h3 class="section" id="Tags-1"><span>8.3 Tags<a class="copiable-link" href="#Tags-1"> ¶</a></span></h3>
|
||
|
||
<p>Tags for top-level (file) nodes are pulled from the variable <code class="code">org-file-tags</code>,
|
||
which is set by the <code class="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 class="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>
|
||
</div>
|
||
<div class="section-level-extent" id="Refs">
|
||
<div class="nav-panel">
|
||
<p>
|
||
Previous: <a href="#Tags" accesskey="p" rel="prev">Tags</a>, Up: <a href="#Node-Properties" accesskey="u" rel="up">Node Properties</a> [<a href="#Keystroke-Index" title="Index" rel="index">Index</a>]</p>
|
||
</div>
|
||
<h3 class="section" id="Refs-1"><span>8.4 Refs<a class="copiable-link" href="#Refs-1"> ¶</a></span></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 “ROAM<em class="math">_REFS</em>” property as follows:
|
||
</p>
|
||
<div class="example">
|
||
<pre class="example-preformatted">* Google
|
||
:PROPERTIES:
|
||
:ROAM_REFS: https://www.google.com/
|
||
:END:
|
||
</pre></div>
|
||
|
||
<p>With the above example, if another node links to <a class="uref" 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 class="code">roam-ref</code> protocol (see <a class="ref" href="#org_002droam_002dprotocol">org-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>
|
||
<ul class="itemize mark-bullet">
|
||
<li>Function: org-roam-ref-add ref
|
||
|
||
<p>Add REF to the node at point. When called interactively, prompt for the
|
||
ref to add.
|
||
</p>
|
||
</li><li>Function: org-roam-ref-remove
|
||
|
||
<p>Remove a ref from the node at point.
|
||
</p></li></ul>
|
||
|
||
<hr>
|
||
</div>
|
||
</div>
|
||
<div class="chapter-level-extent" id="Citations">
|
||
<div class="nav-panel">
|
||
<p>
|
||
Next: <a href="#Completion" accesskey="n" rel="next">Completion</a>, Previous: <a href="#Node-Properties" accesskey="p" rel="prev">Node Properties</a>, Up: <a href="#Top" accesskey="u" rel="up">Org-roam User Manual</a> [<a href="#Keystroke-Index" title="Index" rel="index">Index</a>]</p>
|
||
</div>
|
||
<h2 class="chapter" id="Citations-1"><span>9 Citations<a class="copiable-link" href="#Citations-1"> ¶</a></span></h2>
|
||
|
||
<p>Since version 9.5, Org has first-class support for citations. Org-roam supports
|
||
the caching of both these in-built citations (of form <code class="code">[cite:@key]</code>) and <a class="uref" href="https://github.com/jkitchin/org-ref">org-ref</a>
|
||
citations (of form cite:key).
|
||
</p>
|
||
<p>Org-roam attempts to load both the <code class="code">org-ref</code> and <code class="code">org-cite</code> package when
|
||
indexing files, so no further setup from the user is required for citation
|
||
support.
|
||
</p>
|
||
|
||
<ul class="mini-toc">
|
||
<li><a href="#Using-the-Cached-Information" accesskey="1">Using the Cached Information</a></li>
|
||
</ul>
|
||
<hr>
|
||
<div class="section-level-extent" id="Using-the-Cached-Information">
|
||
<div class="nav-panel">
|
||
<p>
|
||
Up: <a href="#Citations" accesskey="u" rel="up">Citations</a> [<a href="#Keystroke-Index" title="Index" rel="index">Index</a>]</p>
|
||
</div>
|
||
<h3 class="section" id="Using-the-Cached-Information-1"><span>9.1 Using the Cached Information<a class="copiable-link" href="#Using-the-Cached-Information-1"> ¶</a></span></h3>
|
||
|
||
<p>It is common to use take reference notes for academic papers. To designate the
|
||
node to be the canonical node for the academic paper, we can use its unique
|
||
citation key:
|
||
</p>
|
||
<div class="example">
|
||
<pre class="example-preformatted">* Probabilistic Robotics
|
||
:PROPERTIES:
|
||
:ID: 51b7b82c-bbb4-4822-875a-ed548cffda10
|
||
:ROAM_REFS: @thrun2005probabilistic
|
||
:END:
|
||
</pre></div>
|
||
|
||
<p>or
|
||
</p>
|
||
<div class="example">
|
||
<pre class="example-preformatted">* Probabilistic Robotics
|
||
:PROPERTIES:
|
||
:ID: 51b7b82c-bbb4-4822-875a-ed548cffda10
|
||
:ROAM_REFS: [cite:@thrun2005probabilistic]
|
||
:END:
|
||
</pre></div>
|
||
|
||
<p>for <code class="code">org-cite</code>, or:
|
||
</p>
|
||
<div class="example">
|
||
<pre class="example-preformatted">* Probabilistic Robotics
|
||
:PROPERTIES:
|
||
:ID: 51b7b82c-bbb4-4822-875a-ed548cffda10
|
||
:ROAM_REFS: cite:thrun2005probabilistic
|
||
:END:
|
||
</pre></div>
|
||
|
||
<p>for <code class="code">org-ref</code>.
|
||
</p>
|
||
<p>When another node has a citation for that key, we can see it using the
|
||
<code class="code">Reflinks</code> section of the Org-roam buffer.
|
||
</p>
|
||
<p>Extension developers may be interested in retrieving the citations within their
|
||
notes. This information can be found within the <code class="code">citation</code> table of the Org-roam
|
||
database.
|
||
</p>
|
||
<hr>
|
||
</div>
|
||
</div>
|
||
<div class="chapter-level-extent" id="Completion">
|
||
<div class="nav-panel">
|
||
<p>
|
||
Next: <a href="#Encryption" accesskey="n" rel="next">Encryption</a>, Previous: <a href="#Citations" accesskey="p" rel="prev">Citations</a>, Up: <a href="#Top" accesskey="u" rel="up">Org-roam User Manual</a> [<a href="#Keystroke-Index" title="Index" rel="index">Index</a>]</p>
|
||
</div>
|
||
<h2 class="chapter" id="Completion-1"><span>10 Completion<a class="copiable-link" href="#Completion-1"> ¶</a></span></h2>
|
||
|
||
<p>Completions for Org-roam are provided via <code class="code">completion-at-point</code>. Org-roam
|
||
currently provides completions in two scenarios:
|
||
</p>
|
||
<ul class="itemize mark-bullet">
|
||
<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 class="code">M-x completion-at-point</code>. If using <code class="code">company-mode</code>, add <code class="code">company-capf</code> to
|
||
<code class="code">company-backends</code>.
|
||
</p>
|
||
<p>Completions respect <code class="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 class="uref" href="https://github.com/oantolin/orderless">orderless</a>.
|
||
</p>
|
||
|
||
<ul class="mini-toc">
|
||
<li><a href="#Completing-within-Link-Brackets" accesskey="1">Completing within Link Brackets</a></li>
|
||
<li><a href="#Completing-anywhere" accesskey="2">Completing anywhere</a></li>
|
||
</ul>
|
||
<hr>
|
||
<div class="section-level-extent" id="Completing-within-Link-Brackets">
|
||
<div class="nav-panel">
|
||
<p>
|
||
Next: <a href="#Completing-anywhere" accesskey="n" rel="next">Completing anywhere</a>, Up: <a href="#Completion" accesskey="u" rel="up">Completion</a> [<a href="#Keystroke-Index" title="Index" rel="index">Index</a>]</p>
|
||
</div>
|
||
<h3 class="section" id="Completing-within-Link-Brackets-1"><span>10.1 Completing within Link Brackets<a class="copiable-link" href="#Completing-within-Link-Brackets-1"> ¶</a></span></h3>
|
||
|
||
<p>Completions within link brackets are provided by
|
||
<code class="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 class="code">roam:Title</code> link will be inserted, linking to node
|
||
of choice.
|
||
</p>
|
||
<hr>
|
||
</div>
|
||
<div class="section-level-extent" id="Completing-anywhere">
|
||
<div class="nav-panel">
|
||
<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> [<a href="#Keystroke-Index" title="Index" rel="index">Index</a>]</p>
|
||
</div>
|
||
<h3 class="section" id="Completing-anywhere-1"><span>10.2 Completing anywhere<a class="copiable-link" href="#Completing-anywhere-1"> ¶</a></span></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 class="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 class="code">roam:Title</code> link will be inserted
|
||
linking to the node of choice.
|
||
</p>
|
||
<p>This is disabled by default. To enable it, set <code class="code">org-roam-completion-everywhere</code>
|
||
to <code class="code">t</code>:
|
||
</p>
|
||
<div class="example lisp">
|
||
<pre class="lisp-preformatted">(setq org-roam-completion-everywhere t)
|
||
</pre></div>
|
||
|
||
<ul class="itemize mark-bullet">
|
||
<li>Variable: org-roam-completion-everywhere
|
||
</li></ul>
|
||
|
||
<p>When non-nil, provide link completion matching outside of Org links.
|
||
</p>
|
||
<hr>
|
||
</div>
|
||
</div>
|
||
<div class="chapter-level-extent" id="Encryption">
|
||
<div class="nav-panel">
|
||
<p>
|
||
Next: <a href="#The-Templating-System" accesskey="n" rel="next">The Templating System</a>, Previous: <a href="#Completion" accesskey="p" rel="prev">Completion</a>, Up: <a href="#Top" accesskey="u" rel="up">Org-roam User Manual</a> [<a href="#Keystroke-Index" title="Index" rel="index">Index</a>]</p>
|
||
</div>
|
||
<h2 class="chapter" id="Encryption-1"><span>11 Encryption<a class="copiable-link" href="#Encryption-1"> ¶</a></span></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 class="code">.gpg</code>
|
||
extension in your Org-roam capture templates. For example:
|
||
</p>
|
||
<div class="example lisp">
|
||
<pre class="lisp-preformatted">(setq org-roam-capture-templates '(("d" "default" plain "%?"
|
||
:target (file+head "${slug}.org.gpg"
|
||
"#+title: ${title}\n")
|
||
:unnarrowed t)))
|
||
</pre></div>
|
||
|
||
<p>Note that the Org-roam database stores metadata information in plain-text
|
||
(headline text, for example), so if this information is private to you then you
|
||
should also ensure the database is encrypted.
|
||
</p>
|
||
<hr>
|
||
</div>
|
||
<div class="chapter-level-extent" id="The-Templating-System">
|
||
<div class="nav-panel">
|
||
<p>
|
||
Next: <a href="#Extensions" accesskey="n" rel="next">Extensions</a>, Previous: <a href="#Encryption" accesskey="p" rel="prev">Encryption</a>, Up: <a href="#Top" accesskey="u" rel="up">Org-roam User Manual</a> [<a href="#Keystroke-Index" title="Index" rel="index">Index</a>]</p>
|
||
</div>
|
||
<h2 class="chapter" id="The-Templating-System-1"><span>12 The Templating System<a class="copiable-link" href="#The-Templating-System-1"> ¶</a></span></h2>
|
||
|
||
<p>Org-roam extends the <code class="code">org-capture</code> system, providing a smoother note-taking
|
||
experience. However, these extensions mean Org-roam capture templates are
|
||
incompatible with <code class="code">org-capture</code> templates.
|
||
</p>
|
||
<p>Org-roam’s templates are specified by <code class="code">org-roam-capture-templates</code>. Just like
|
||
<code class="code">org-capture-templates</code>, <code class="code">org-roam-capture-templates</code> can contain multiple
|
||
templates. If <code class="code">org-roam-capture-templates</code> only contains one template, there
|
||
will be no prompt for template selection.
|
||
</p>
|
||
|
||
<ul class="mini-toc">
|
||
<li><a href="#Template-Walkthrough" accesskey="1">Template Walkthrough</a></li>
|
||
<li><a href="#Org_002droam-Template-Expansion" accesskey="2">Org-roam Template Expansion</a></li>
|
||
</ul>
|
||
<hr>
|
||
<div class="section-level-extent" id="Template-Walkthrough">
|
||
<div class="nav-panel">
|
||
<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> [<a href="#Keystroke-Index" title="Index" rel="index">Index</a>]</p>
|
||
</div>
|
||
<h3 class="section" id="Template-Walkthrough-1"><span>12.1 Template Walkthrough<a class="copiable-link" href="#Template-Walkthrough-1"> ¶</a></span></h3>
|
||
|
||
<p>To demonstrate the additions made to org-capture templates. Here, we explain
|
||
the default template, reproduced below. You will find most of the elements
|
||
of the template are similar to <code class="code">org-capture</code> templates.
|
||
</p>
|
||
<div class="example lisp">
|
||
<pre class="lisp-preformatted">(("d" "default" plain "%?"
|
||
:target (file+head "%<%Y%m%d%H%M%S>-${slug}.org"
|
||
"#+title: ${title}\n")
|
||
:unnarrowed t))
|
||
</pre></div>
|
||
|
||
<ol class="enumerate">
|
||
<li> The template has short key <code class="code">"d"</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 class="code">"default"</code>.
|
||
</li><li> <code class="code">plain</code> text is inserted. Other options include Org headings via
|
||
<code class="code">entry</code>.
|
||
</li><li> Notice that the <code class="code">target</code> that’s usually in Org-capture templates is missing
|
||
here.
|
||
</li><li> <code class="code">"%?"</code> is the template inserted on each call to <code class="code">org-roam-capture-</code>.
|
||
This template means don’t insert any content, but place the cursor here.
|
||
</li><li> <code class="code">:target</code> is a compulsory specification in the Org-roam capture template. The
|
||
first element of the list indicates the type of the target, the second
|
||
element indicates the location of the captured node, and the rest of the
|
||
elements indicate prefilled template that will be inserted and the position
|
||
of the point will be adjusted for. The latter behavior varies from type to
|
||
type of the capture target.
|
||
</li><li> <code class="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></ol>
|
||
|
||
<p>See the <code class="code">org-roam-capture-templates</code> documentation for more details and
|
||
customization options.
|
||
</p>
|
||
<hr>
|
||
</div>
|
||
<div class="section-level-extent" id="Org_002droam-Template-Expansion">
|
||
<div class="nav-panel">
|
||
<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> [<a href="#Keystroke-Index" title="Index" rel="index">Index</a>]</p>
|
||
</div>
|
||
<h3 class="section" id="Org_002droam-Template-Expansion-1"><span>12.2 Org-roam Template Expansion<a class="copiable-link" href="#Org_002droam-Template-Expansion-1"> ¶</a></span></h3>
|
||
|
||
<p>Org-roam’s template definitions also extend org-capture’s template syntax, to
|
||
allow prefilling of strings. We have seen a glimpse of this in <a class="ref" href="#Template-Walkthrough">Template
|
||
Walkthrough</a>.
|
||
</p>
|
||
<p>Org-roam provides the <code class="code">${foo}</code> syntax for substituting variables with known
|
||
strings. <code class="code">${foo}</code>’s substitution is performed as follows:
|
||
</p>
|
||
<ol class="enumerate">
|
||
<li> If <code class="code">foo</code> is a function, <code class="code">foo</code> is called with the current node as its
|
||
argument.
|
||
</li><li> Else if <code class="code">org-roam-node-foo</code> is a function, <code class="code">foo</code> is called with the current node
|
||
as its argument. The <code class="code">org-roam-node-</code> prefix defines many of Org-roam’s node
|
||
accessors such as <code class="code">org-roam-node-title</code> and <code class="code">org-roam-node-level</code>.
|
||
</li><li> Else look up <code class="code">org-roam-capture--info</code> for <code class="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 class="code">completing-read</code>.
|
||
<ol class="enumerate">
|
||
<li> Org-roam also provides the <code class="code">${foo=default_val}</code> syntax, where if a default
|
||
value is provided, will be the initial value for the <code class="code">foo</code> key during
|
||
minibuffer completion.
|
||
</li></ol>
|
||
</li></ol>
|
||
|
||
<p>One can check the list of available keys for nodes by inspecting the
|
||
<code class="code">org-roam-node</code> struct. At the time of writing, it is:
|
||
</p>
|
||
<div class="example lisp">
|
||
<pre class="lisp-preformatted">(cl-defstruct (org-roam-node (:constructor org-roam-node-create)
|
||
(:copier nil))
|
||
"A heading or top level file with an assigned ID property."
|
||
file file-hash file-atime file-mtime
|
||
id level point todo priority scheduled deadline title properties olp
|
||
tags aliases refs)
|
||
</pre></div>
|
||
|
||
<p>This makes <code class="code">${file}</code>, <code class="code">${file-hash}</code> etc. all valid substitutions.
|
||
</p>
|
||
<hr>
|
||
</div>
|
||
</div>
|
||
<div class="chapter-level-extent" id="Extensions">
|
||
<div class="nav-panel">
|
||
<p>
|
||
Next: <a href="#Performance-Optimization" accesskey="n" rel="next">Performance Optimization</a>, Previous: <a href="#The-Templating-System" accesskey="p" rel="prev">The Templating System</a>, Up: <a href="#Top" accesskey="u" rel="up">Org-roam User Manual</a> [<a href="#Keystroke-Index" title="Index" rel="index">Index</a>]</p>
|
||
</div>
|
||
<h2 class="chapter" id="Extensions-1"><span>13 Extensions<a class="copiable-link" href="#Extensions-1"> ¶</a></span></h2>
|
||
|
||
|
||
<ul class="mini-toc">
|
||
<li><a href="#org_002droam_002dprotocol" accesskey="1">org-roam-protocol</a></li>
|
||
<li><a href="#org_002droam_002dgraph" accesskey="2">org-roam-graph</a></li>
|
||
<li><a href="#org_002droam_002ddailies" accesskey="3">org-roam-dailies</a></li>
|
||
<li><a href="#org_002droam_002dexport" accesskey="4">org-roam-export</a></li>
|
||
</ul>
|
||
<hr>
|
||
<div class="section-level-extent" id="org_002droam_002dprotocol">
|
||
<div class="nav-panel">
|
||
<p>
|
||
Next: <a href="#org_002droam_002dgraph" accesskey="n" rel="next">org-roam-graph</a>, Up: <a href="#Extensions" accesskey="u" rel="up">Extensions</a> [<a href="#Keystroke-Index" title="Index" rel="index">Index</a>]</p>
|
||
</div>
|
||
<h3 class="section" id="org_002droam_002dprotocol-1"><span>13.1 org-roam-protocol<a class="copiable-link" href="#org_002droam_002dprotocol-1"> ¶</a></span></h3>
|
||
|
||
<p>Org-roam provides extensions for capturing content from external applications
|
||
such as the browser, via <code class="code">org-protocol</code>. Org-roam extends <code class="code">org-protocol</code> with 2
|
||
protocols: the <code class="code">roam-node</code> and <code class="code">roam-ref</code> protocols.
|
||
</p>
|
||
|
||
<ul class="mini-toc">
|
||
<li><a href="#Installation-_00281_0029" accesskey="1">Installation</a></li>
|
||
<li><a href="#The-roam_002dnode-protocol" accesskey="2">The roam-node protocol</a></li>
|
||
<li><a href="#The-roam_002dref-protocol" accesskey="3">The roam-ref protocol</a></li>
|
||
</ul>
|
||
<hr>
|
||
<div class="subsection-level-extent" id="Installation-_00281_0029">
|
||
<div class="nav-panel">
|
||
<p>
|
||
Next: <a href="#The-roam_002dnode-protocol" accesskey="n" rel="next">The roam-node protocol</a>, Up: <a href="#org_002droam_002dprotocol" accesskey="u" rel="up">org-roam-protocol</a> [<a href="#Keystroke-Index" title="Index" rel="index">Index</a>]</p>
|
||
</div>
|
||
<h4 class="subsection" id="Installation-2"><span>13.1.1 Installation<a class="copiable-link" href="#Installation-2"> ¶</a></span></h4>
|
||
|
||
<p>To enable Org-roam’s protocol extensions, simply add the following to your init
|
||
file:
|
||
</p>
|
||
<div class="example lisp">
|
||
<pre class="lisp-preformatted">(require 'org-roam-protocol)
|
||
</pre></div>
|
||
|
||
<p>We also need to set up <code class="code">org-protocol</code>: the instructions for setting up
|
||
<code class="code">org-protocol</code> are reproduced here.
|
||
</p>
|
||
<p>On a high-level, external calls are passed to Emacs via <code class="code">emacsclient</code>.
|
||
<code class="code">org-protocol</code> intercepts these and runs custom actions based on the protocols
|
||
registered. Hence, to use <code class="code">org-protocol</code>, once must:
|
||
</p>
|
||
<ol class="enumerate">
|
||
<li> launch the <code class="code">emacsclient</code> process
|
||
</li><li> Register <code class="code">org-protocol://</code> as a valid scheme-handler
|
||
</li></ol>
|
||
|
||
<p>The instructions for the latter for each operating system is detailed below.
|
||
</p>
|
||
|
||
<ul class="mini-toc">
|
||
<li><a href="#Linux" accesskey="1">Linux</a></li>
|
||
<li><a href="#Mac-OS" accesskey="2">Mac OS</a></li>
|
||
<li><a href="#Windows" accesskey="3">Windows</a></li>
|
||
</ul>
|
||
<hr>
|
||
<div class="unnumberedsubsubsec-level-extent" id="Linux">
|
||
<div class="nav-panel">
|
||
<p>
|
||
Next: <a href="#Mac-OS" accesskey="n" rel="next">Mac OS</a>, Up: <a href="#Installation-_00281_0029" accesskey="u" rel="up">Installation</a> [<a href="#Keystroke-Index" title="Index" rel="index">Index</a>]</p>
|
||
</div>
|
||
<h4 class="unnumberedsubsubsec" id="Linux-1"><span>Linux<a class="copiable-link" href="#Linux-1"> ¶</a></span></h4>
|
||
|
||
<p>For Linux users, create a desktop application in
|
||
<code class="code">~/.local/share/applications/org-protocol.desktop</code>:
|
||
</p>
|
||
<div class="example">
|
||
<pre class="example-preformatted">[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 class="code">org-protocol://</code> links with the desktop application by
|
||
running in your shell:
|
||
</p>
|
||
<div class="example">
|
||
<pre class="example-preformatted">xdg-mime default org-protocol.desktop x-scheme-handler/org-protocol
|
||
</pre></div>
|
||
|
||
<p>To disable the “confirm” prompt in Chrome, you can also make Chrome show a
|
||
checkbox to tick, so that the <code class="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-preformatted">sudo mkdir -p /etc/opt/chrome/policies/managed/
|
||
sudo tee /etc/opt/chrome/policies/managed/external_protocol_dialog.json >/dev/null <<'EOF'
|
||
{
|
||
"ExternalProtocolDialogShowAlwaysOpenCheckbox": 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 <chrome://restart>) to
|
||
make the new policy take effect.
|
||
</p>
|
||
<p>See <a class="uref" href="https://www.chromium.org/administrators/linux-quick-start">here</a> for more info on the <code class="code">/etc/opt/chrome/policies/managed</code> directory and
|
||
<a class="uref" href="https://cloud.google.com/docs/chrome-enterprise/policies/?policy=ExternalProtocolDialogShowAlwaysOpenCheckbox">here</a> for information on the <code class="code">ExternalProtocolDialogShowAlwaysOpenCheckbox</code> policy.
|
||
</p>
|
||
<hr>
|
||
</div>
|
||
<div class="unnumberedsubsubsec-level-extent" id="Mac-OS">
|
||
<div class="nav-panel">
|
||
<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</a> [<a href="#Keystroke-Index" title="Index" rel="index">Index</a>]</p>
|
||
</div>
|
||
<h4 class="unnumberedsubsubsec" id="Mac-OS-1"><span>Mac OS<a class="copiable-link" href="#Mac-OS-1"> ¶</a></span></h4>
|
||
|
||
<p>For Mac OS, we need to create our own application.
|
||
</p>
|
||
<ol class="enumerate">
|
||
<li> Launch Script Editor
|
||
</li><li> Use the following script, paying attention to the path to <code class="code">emacsclient</code>:
|
||
</li></ol>
|
||
|
||
<div class="example lisp">
|
||
<pre class="lisp-preformatted">on open location this_URL
|
||
set EC to "/usr/local/bin/emacsclient --no-wait "
|
||
set filePath to quoted form of this_URL
|
||
do shell script EC & filePath & " &> /dev/null &"
|
||
tell application "Emacs" to activate
|
||
end open location
|
||
</pre></div>
|
||
|
||
<ol class="enumerate">
|
||
<li> Save the script in <code class="code">/Applications/OrgProtocolClient.app</code>, changing the script type to
|
||
“Application”, rather than “Script”.
|
||
</li><li> Edit <code class="code">/Applications/OrgProtocolClient.app/Contents/Info.plist</code>, adding the
|
||
following before the last <code class="code"></dict></code> tag:
|
||
</li></ol>
|
||
|
||
<div class="example">
|
||
<pre class="example-preformatted"><key>CFBundleURLTypes</key>
|
||
<array>
|
||
<dict>
|
||
<key>CFBundleURLName</key>
|
||
<string>org-protocol handler</string>
|
||
<key>CFBundleURLSchemes</key>
|
||
<array>
|
||
<string>org-protocol</string>
|
||
</array>
|
||
</dict>
|
||
</array>
|
||
</pre></div>
|
||
|
||
<ol class="enumerate">
|
||
<li> Save the file, and run the <code class="code">OrgProtocolClient.app</code> to register the protocol.
|
||
</li></ol>
|
||
|
||
<p>To disable the “confirm” prompt in Chrome, you can also make Chrome
|
||
show a checkbox to tick, so that the <code class="code">OrgProtocol</code> app will be used
|
||
without confirmation. To do this, run in a shell:
|
||
</p>
|
||
<div class="example">
|
||
<pre class="example-preformatted">defaults write com.google.Chrome ExternalProtocolDialogShowAlwaysOpenCheckbox -bool true
|
||
</pre></div>
|
||
|
||
<p>If you’re using <a class="uref" href="https://github.com/railwaycat/homebrew-emacsmacport">Emacs Mac Port</a>, it registered its ‘Emacs.app‘ as the default
|
||
handler for the URL scheme ‘org-protocol‘. To make <code class="code">OrgProtocol.app</code>
|
||
the default handler instead, run:
|
||
</p>
|
||
<div class="example">
|
||
<pre class="example-preformatted">defaults write com.apple.LaunchServices/com.apple.launchservices.secure LSHandlers -array-add \
|
||
'{"LSHandlerPreferredVersions" = { "LSHandlerRoleAll" = "-"; }; LSHandlerRoleAll = "org.yourusername.OrgProtocol"; LSHandlerURLScheme = "org-protocol";}'
|
||
</pre></div>
|
||
|
||
<p>Then restart your computer.
|
||
</p>
|
||
<p>If you’re using the <a class="uref" href="https://formulae.brew.sh/formula/emacs">Emacs Homebrew formula</a>, you may need one of the following additional configurations:
|
||
</p>
|
||
<ol class="enumerate">
|
||
<li> Add option ‘-c‘ to ‘emacsclient‘ in the script, and start emacs from command line with ‘emacs –daemon‘
|
||
</li></ol>
|
||
|
||
<div class="example lisp">
|
||
<pre class="lisp-preformatted">on open location this_URL
|
||
set EC to "/usr/local/bin/emacsclient -c --no-wait "
|
||
set filePath to quoted form of this_URL
|
||
do shell script EC & filePath & " &> /dev/null &"
|
||
tell application "Emacs" to activate
|
||
end open location
|
||
</pre></div>
|
||
|
||
<ol class="enumerate">
|
||
<li> Add ‘(server-start)‘ in .emacs (in this case you do not need option ‘-c‘ for ‘emacsclient‘ in the script, and you do not need to start emacs with ‘emacs –daemon‘
|
||
</li></ol>
|
||
|
||
<ul class="itemize mark-bullet">
|
||
<li><a class="anchor" id="Testing-org_002dprotocol"></a>Testing org-protocol
|
||
|
||
|
||
<p>To test that you have the handler setup and registered properly from the command
|
||
line you can run:
|
||
</p>
|
||
<div class="example">
|
||
<pre class="example-preformatted">open org-protocol://roam-ref\?template=r\&ref=test\&title=this
|
||
</pre></div>
|
||
|
||
<p>If you get an error similar too this or the wrong handler is run:
|
||
</p>
|
||
<blockquote class="quotation">
|
||
<p>No application knows how to open URL org-protocol://roam-ref?template=r&ref=test&title=this (Error Domain=NSOSStatusErrorDomain Code=-10814 “kLSApplicationNotFoundErr: E.g. no application claims the file” UserInfo={<em class="math">_LSLine</em>=1489, _LSFunction=runEvaluator}).
|
||
</p>
|
||
</blockquote>
|
||
|
||
<p>You may need to manually register your handler, like this:
|
||
</p>
|
||
<div class="example">
|
||
<pre class="example-preformatted">/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/Support/lsregister -R -f /Applications/OrgProtocolClient.app
|
||
</pre></div>
|
||
|
||
<p>Here is a link to the lsregister command that is really useful: <a class="uref" href="https://eclecticlight.co/2019/03/25/lsregister-a-valuable-undocumented-command-for-launchservices/">https://eclecticlight.co/2019/03/25/lsregister-a-valuable-undocumented-command-for-launchservices/</a>
|
||
</p></li></ul>
|
||
|
||
<hr>
|
||
</div>
|
||
<div class="unnumberedsubsubsec-level-extent" id="Windows">
|
||
<div class="nav-panel">
|
||
<p>
|
||
Previous: <a href="#Mac-OS" accesskey="p" rel="prev">Mac OS</a>, Up: <a href="#Installation-_00281_0029" accesskey="u" rel="up">Installation</a> [<a href="#Keystroke-Index" title="Index" rel="index">Index</a>]</p>
|
||
</div>
|
||
<h4 class="unnumberedsubsubsec" id="Windows-1"><span>Windows<a class="copiable-link" href="#Windows-1"> ¶</a></span></h4>
|
||
|
||
<p>For Windows, create a temporary <code class="code">org-protocol.reg</code> file:
|
||
</p>
|
||
<div class="example">
|
||
<pre class="example-preformatted">REGEDIT4
|
||
|
||
[HKEY_CLASSES_ROOT\org-protocol]
|
||
@="URL:Org Protocol"
|
||
"URL Protocol"=""
|
||
[HKEY_CLASSES_ROOT\org-protocol\shell]
|
||
[HKEY_CLASSES_ROOT\org-protocol\shell\open]
|
||
[HKEY_CLASSES_ROOT\org-protocol\shell\open\command]
|
||
@="\"C:\\Windows\\System32\\wsl.exe\" emacsclient \"%1\""
|
||
</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-preformatted">@="\"c:\\path\\to\\emacs\\bin\\emacsclientw.exe\" \"%1\""
|
||
</pre></div>
|
||
|
||
<p>After executing the .reg file, the protocol is registered and you can delete the
|
||
file.
|
||
</p>
|
||
<hr>
|
||
</div>
|
||
</div>
|
||
<div class="subsection-level-extent" id="The-roam_002dnode-protocol">
|
||
<div class="nav-panel">
|
||
<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</a>, Up: <a href="#org_002droam_002dprotocol" accesskey="u" rel="up">org-roam-protocol</a> [<a href="#Keystroke-Index" title="Index" rel="index">Index</a>]</p>
|
||
</div>
|
||
<h4 class="subsection" id="The-roam_002dnode-protocol-1"><span>13.1.2 The roam-node protocol<a class="copiable-link" href="#The-roam_002dnode-protocol-1"> ¶</a></span></h4>
|
||
|
||
<p>The roam-node protocol opens the node with ID specified by the <code class="code">node</code> key (e.g.
|
||
<code class="code">org-protocol://roam-node?node=node-id</code>). <code class="code">org-roam-graph</code> uses this to make the
|
||
graph navigable.
|
||
</p>
|
||
<hr>
|
||
</div>
|
||
<div class="subsection-level-extent" id="The-roam_002dref-protocol">
|
||
<div class="nav-panel">
|
||
<p>
|
||
Previous: <a href="#The-roam_002dnode-protocol" accesskey="p" rel="prev">The roam-node protocol</a>, Up: <a href="#org_002droam_002dprotocol" accesskey="u" rel="up">org-roam-protocol</a> [<a href="#Keystroke-Index" title="Index" rel="index">Index</a>]</p>
|
||
</div>
|
||
<h4 class="subsection" id="The-roam_002dref-protocol-1"><span>13.1.3 The roam-ref protocol<a class="copiable-link" href="#The-roam_002dref-protocol-1"> ¶</a></span></h4>
|
||
|
||
<p>This protocol finds or creates a new note with a given <code class="code">ROAM_REFS</code>:
|
||
</p>
|
||
<img class="image" src="images/roam-ref.gif" alt="images/roam-ref">
|
||
|
||
<p>To use this, create the following <a class="uref" href="https://en.wikipedia.org/wiki/Bookmarklet">bookmarklet</a> in your browser:
|
||
</p>
|
||
<div class="example">
|
||
<pre class="example-preformatted">javascript:location.href =
|
||
'org-protocol://roam-ref?template=r&ref='
|
||
+ encodeURIComponent(location.href)
|
||
+ '&title='
|
||
+ encodeURIComponent(document.title)
|
||
+ '&body='
|
||
+ encodeURIComponent(window.getSelection())
|
||
</pre></div>
|
||
|
||
<p>or as a keybinding in <code class="code">qutebrowser</code> in , using the <code class="code">config.py</code> file (see
|
||
<a class="uref" href="https://github.com/qutebrowser/qutebrowser/blob/master/doc/help/configuring.asciidoc">Configuring qutebrowser</a>):
|
||
</p>
|
||
<div class="example">
|
||
<pre class="example-preformatted">config.bind("<Ctrl-r>", "open javascript:location.href='org-protocol://roam-ref?template=r&ref='+encodeURIComponent(location.href)+'&title='+encodeURIComponent(document.title)")
|
||
</pre></div>
|
||
|
||
<p>where <code class="code">template</code> is the template key for a template in
|
||
<code class="code">org-roam-capture-ref-templates</code> (see <a class="ref" href="#The-Templating-System">The Templating System</a>).
|
||
</p>
|
||
<hr>
|
||
</div>
|
||
</div>
|
||
<div class="section-level-extent" id="org_002droam_002dgraph">
|
||
<div class="nav-panel">
|
||
<p>
|
||
Next: <a href="#org_002droam_002ddailies" accesskey="n" rel="next">org-roam-dailies</a>, Previous: <a href="#org_002droam_002dprotocol" accesskey="p" rel="prev">org-roam-protocol</a>, Up: <a href="#Extensions" accesskey="u" rel="up">Extensions</a> [<a href="#Keystroke-Index" title="Index" rel="index">Index</a>]</p>
|
||
</div>
|
||
<h3 class="section" id="org_002droam_002dgraph-1"><span>13.2 org-roam-graph<a class="copiable-link" href="#org_002droam_002dgraph-1"> ¶</a></span></h3>
|
||
|
||
<p>Org-roam provides basic graphing capabilities to explore interconnections
|
||
between notes, in <code class="code">org-roam-graph</code>. This is done by performing SQL queries and
|
||
generating images using <a class="uref" href="https://graphviz.org/">Graphviz</a>. The graph can also be navigated: see <a class="ref" href="#org_002droam_002dprotocol">org-roam-protocol</a>.
|
||
</p>
|
||
<p>The entry point to graph creation is <code class="code">org-roam-graph</code>.
|
||
</p>
|
||
<ul class="itemize mark-bullet">
|
||
<li>Function: org-roam-graph & optional arg node
|
||
</li></ul>
|
||
|
||
<p>Build and display a graph for NODE.
|
||
ARG may be any of the following values:
|
||
</p>
|
||
<ul class="itemize mark-bullet">
|
||
<li><code class="code">nil</code> show the full graph.
|
||
</li><li><code class="code">integer</code> an integer argument <code class="code">N</code> will show the graph for the connected
|
||
components to node up to <code class="code">N</code> steps away.
|
||
</li></ul>
|
||
|
||
<ul class="itemize mark-bullet">
|
||
<li>User Option: org-roam-graph-executable
|
||
|
||
<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 class="code">neato</code> in place of <code class="code">dot</code>, which generates a more
|
||
compact graph layout.
|
||
</p>
|
||
</li><li>User Option: org-roam-graph-viewer
|
||
|
||
<p>Org-roam defaults to using Firefox (located on PATH) to view the SVG, but you
|
||
may choose to set it to:
|
||
</p>
|
||
<ol class="enumerate">
|
||
<li> A string, which is a path to the program used
|
||
</li><li> a function accepting a single argument: the graph file path.
|
||
</li></ol>
|
||
|
||
<p><code class="code">nil</code> uses <code class="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="example lisp">
|
||
<pre class="lisp-preformatted">(setq org-roam-graph-viewer
|
||
(lambda (file)
|
||
(let ((org-roam-graph-viewer "/mnt/c/Program Files/Mozilla Firefox/firefox.exe"))
|
||
(org-roam-graph--open (concat "file://///wsl$/Ubuntu" file)))))
|
||
</pre></div>
|
||
</li></ul>
|
||
|
||
|
||
<ul class="mini-toc">
|
||
<li><a href="#Graph-Options" accesskey="1">Graph Options</a></li>
|
||
</ul>
|
||
<hr>
|
||
<div class="subsection-level-extent" id="Graph-Options">
|
||
<div class="nav-panel">
|
||
<p>
|
||
Up: <a href="#org_002droam_002dgraph" accesskey="u" rel="up">org-roam-graph</a> [<a href="#Keystroke-Index" title="Index" rel="index">Index</a>]</p>
|
||
</div>
|
||
<h4 class="subsection" id="Graph-Options-1"><span>13.2.1 Graph Options<a class="copiable-link" href="#Graph-Options-1"> ¶</a></span></h4>
|
||
|
||
<p>Graphviz provides many options for customizing the graph output, and Org-roam
|
||
supports some of them. See <a class="uref" href="https://graphviz.gitlab.io/_pages/doc/info/attrs.html">https://graphviz.gitlab.io/_pages/doc/info/attrs.html</a>
|
||
for customizable options.
|
||
</p>
|
||
<ul class="itemize mark-bullet">
|
||
<li>User Option: org-roam-graph-filetype
|
||
|
||
<p>The file type to generate for graphs. This defaults to <code class="code">"svg"</code>.
|
||
</p>
|
||
</li><li>User Option: org-roam-graph-extra-config
|
||
|
||
<p>Extra options passed to graphviz for the digraph (The “G” attributes).
|
||
Example: <code class="code">'~(("rankdir" . "LR"))</code>
|
||
</p>
|
||
</li><li>User Option: org-roam-graph-node-extra-config
|
||
|
||
<p>An alist of options to style the nodes.
|
||
The car of the alist node type such as <code class="code">"id"</code>, or <code class="code">"http"</code>. The cdr of the
|
||
list is another alist of Graphviz node options (the “N” attributes).
|
||
</p>
|
||
</li><li>User Option: org-roam-graph-edge-extra-config
|
||
|
||
<p>Extra options for edges in the graphviz output (The “E” attributes).
|
||
Example: <code class="code">'(("dir" . "back"))</code>
|
||
</p></li></ul>
|
||
|
||
<hr>
|
||
</div>
|
||
</div>
|
||
<div class="section-level-extent" id="org_002droam_002ddailies">
|
||
<div class="nav-panel">
|
||
<p>
|
||
Next: <a href="#org_002droam_002dexport" accesskey="n" rel="next">org-roam-export</a>, Previous: <a href="#org_002droam_002dgraph" accesskey="p" rel="prev">org-roam-graph</a>, Up: <a href="#Extensions" accesskey="u" rel="up">Extensions</a> [<a href="#Keystroke-Index" title="Index" rel="index">Index</a>]</p>
|
||
</div>
|
||
<h3 class="section" id="org_002droam_002ddailies-1"><span>13.3 org-roam-dailies<a class="copiable-link" href="#org_002droam_002ddailies-1"> ¶</a></span></h3>
|
||
|
||
<p>Org-roam provides journaling capabilities akin to
|
||
Org-journal with <code class="code">org-roam-dailies</code>.
|
||
</p>
|
||
|
||
<ul class="mini-toc">
|
||
<li><a href="#Configuration" accesskey="1">Configuration</a></li>
|
||
<li><a href="#Usage" accesskey="2">Usage</a></li>
|
||
</ul>
|
||
<hr>
|
||
<div class="subsection-level-extent" id="Configuration">
|
||
<div class="nav-panel">
|
||
<p>
|
||
Next: <a href="#Usage" accesskey="n" rel="next">Usage</a>, Up: <a href="#org_002droam_002ddailies" accesskey="u" rel="up">org-roam-dailies</a> [<a href="#Keystroke-Index" title="Index" rel="index">Index</a>]</p>
|
||
</div>
|
||
<h4 class="subsection" id="Configuration-1"><span>13.3.1 Configuration<a class="copiable-link" href="#Configuration-1"> ¶</a></span></h4>
|
||
|
||
<p>For <code class="code">org-roam-dailies</code> to work, you need to define two variables:
|
||
</p>
|
||
<ul class="itemize mark-bullet">
|
||
<li>Variable: <code class="code">org-roam-dailies-directory</code>
|
||
|
||
<p>Path to daily-notes. This path is relative to <code class="code">org-roam-directory</code>.
|
||
</p>
|
||
</li><li>Variable: <code class="code">org-roam-dailies-capture-templates</code>
|
||
|
||
<p>Capture templates for daily-notes in Org-roam.
|
||
</p></li></ul>
|
||
|
||
<p>Here is a sane default configuration:
|
||
</p>
|
||
<div class="example lisp">
|
||
<pre class="lisp-preformatted">(setq org-roam-dailies-directory "daily/")
|
||
|
||
(setq org-roam-dailies-capture-templates
|
||
'(("d" "default" entry
|
||
"* %?"
|
||
:target (file+head "%<%Y-%m-%d>.org"
|
||
"#+title: %<%Y-%m-%d>\n"))))
|
||
</pre></div>
|
||
|
||
<p>See <a class="ref" href="#The-Templating-System">The Templating System</a> for creating new templates.
|
||
</p>
|
||
<hr>
|
||
</div>
|
||
<div class="subsection-level-extent" id="Usage">
|
||
<div class="nav-panel">
|
||
<p>
|
||
Previous: <a href="#Configuration" accesskey="p" rel="prev">Configuration</a>, Up: <a href="#org_002droam_002ddailies" accesskey="u" rel="up">org-roam-dailies</a> [<a href="#Keystroke-Index" title="Index" rel="index">Index</a>]</p>
|
||
</div>
|
||
<h4 class="subsection" id="Usage-1"><span>13.3.2 Usage<a class="copiable-link" href="#Usage-1"> ¶</a></span></h4>
|
||
|
||
<p><code class="code">org-roam-dailies</code> provides these interactive functions:
|
||
</p>
|
||
<ul class="itemize mark-bullet">
|
||
<li>Function: <code class="code">org-roam-dailies-capture-today</code> &optional goto
|
||
|
||
<p>Create an entry in the daily note for today.
|
||
</p>
|
||
<p>When <code class="code">goto</code> is non-nil, go to the note without creating an entry.
|
||
</p>
|
||
</li><li>Function: <code class="code">org-roam-dailies-goto-today</code>
|
||
|
||
<p>Find the daily note for today, creating it if necessary.
|
||
</p></li></ul>
|
||
|
||
<p>There are variants of those commands for <code class="code">-yesterday</code> and <code class="code">-tomorrow</code>:
|
||
</p>
|
||
<ul class="itemize mark-bullet">
|
||
<li>Function: <code class="code">org-roam-dailies-capture-yesterday</code> n &optional goto
|
||
|
||
<p>Create an entry in the daily note for yesterday.
|
||
</p>
|
||
<p>With numeric argument <code class="code">n</code>, use the daily note <code class="code">n</code> days in the past.
|
||
</p>
|
||
</li><li>Function: <code class="code">org-roam-dailies-goto-yesterday</code>
|
||
|
||
<p>With numeric argument N, use the daily-note N days in the future.
|
||
</p></li></ul>
|
||
|
||
<p>There are also commands which allow you to use Emacs’s <code class="code">calendar</code> to find the date
|
||
</p>
|
||
<ul class="itemize mark-bullet">
|
||
<li>Function: <code class="code">org-roam-dailies-capture-date</code>
|
||
|
||
<p>Create an entry in the daily note for a date using the calendar.
|
||
</p>
|
||
<p>Prefer past dates, unless <code class="code">prefer-future</code> is non-nil.
|
||
</p>
|
||
<p>With a ’C-u’ prefix or when <code class="code">goto</code> is non-nil, go the note without
|
||
creating an entry.
|
||
</p>
|
||
</li><li>Function: <code class="code">org-roam-dailies-goto-date</code>
|
||
|
||
<p>Find the daily note for a date using the calendar, creating it if necessary.
|
||
</p>
|
||
<p>Prefer past dates, unless <code class="code">prefer-future</code> is non-nil.
|
||
</p>
|
||
</li><li>Function: <code class="code">org-roam-dailies-find-directory</code>
|
||
|
||
<p>Find and open <code class="code">org-roam-dailies-directory</code>.
|
||
</p>
|
||
</li><li>Function: <code class="code">org-roam-dailies-goto-previous-note</code>
|
||
|
||
<p>When in an daily-note, find the previous one.
|
||
</p>
|
||
</li><li>Function: <code class="code">org-roam-dailies-goto-next-note</code>
|
||
|
||
<p>When in an daily-note, find the next one.
|
||
</p></li></ul>
|
||
|
||
<hr>
|
||
</div>
|
||
</div>
|
||
<div class="section-level-extent" id="org_002droam_002dexport">
|
||
<div class="nav-panel">
|
||
<p>
|
||
Previous: <a href="#org_002droam_002ddailies" accesskey="p" rel="prev">org-roam-dailies</a>, Up: <a href="#Extensions" accesskey="u" rel="up">Extensions</a> [<a href="#Keystroke-Index" title="Index" rel="index">Index</a>]</p>
|
||
</div>
|
||
<h3 class="section" id="org_002droam_002dexport-1"><span>13.4 org-roam-export<a class="copiable-link" href="#org_002droam_002dexport-1"> ¶</a></span></h3>
|
||
|
||
<p>Because Org-roam files are plain org files, they can be exported easily using
|
||
<code class="code">org-export</code> to a variety of formats, including <code class="code">html</code> and <code class="code">pdf</code>. However,
|
||
Org-roam relies heavily on ID links, which Org’s html export has poor support
|
||
of. To fix this, Org-roam provides a bunch of overrides to better support
|
||
export. To use them, simply run:
|
||
</p>
|
||
<div class="example lisp">
|
||
<pre class="lisp-preformatted">(require 'org-roam-export)
|
||
</pre></div>
|
||
|
||
<hr>
|
||
</div>
|
||
</div>
|
||
<div class="chapter-level-extent" id="Performance-Optimization">
|
||
<div class="nav-panel">
|
||
<p>
|
||
Next: <a href="#The-Org_002dmode-Ecosystem" accesskey="n" rel="next">The Org-mode Ecosystem</a>, Previous: <a href="#Extensions" accesskey="p" rel="prev">Extensions</a>, Up: <a href="#Top" accesskey="u" rel="up">Org-roam User Manual</a> [<a href="#Keystroke-Index" title="Index" rel="index">Index</a>]</p>
|
||
</div>
|
||
<h2 class="chapter" id="Performance-Optimization-1"><span>14 Performance Optimization<a class="copiable-link" href="#Performance-Optimization-1"> ¶</a></span></h2>
|
||
|
||
|
||
<ul class="mini-toc">
|
||
<li><a href="#Garbage-Collection" accesskey="1">Garbage Collection</a></li>
|
||
</ul>
|
||
<hr>
|
||
<div class="section-level-extent" id="Garbage-Collection">
|
||
<div class="nav-panel">
|
||
<p>
|
||
Up: <a href="#Performance-Optimization" accesskey="u" rel="up">Performance Optimization</a> [<a href="#Keystroke-Index" title="Index" rel="index">Index</a>]</p>
|
||
</div>
|
||
<h3 class="section" id="Garbage-Collection-1"><span>14.1 Garbage Collection<a class="copiable-link" href="#Garbage-Collection-1"> ¶</a></span></h3>
|
||
|
||
<p>During the cache-build process, Org-roam generates a lot of in-memory
|
||
data-structures (such as the Org file’s AST), which are discarded after use.
|
||
These structures are garbage collected at regular intervals (see <a data-manual="elisp" href="https://www.gnu.org/software/emacs/manual/html_mono/elisp.html#Garbage-Collection">info:elisp#Garbage Collection</a>).
|
||
</p>
|
||
<p>Org-roam provides the option <code class="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 class="code">org-roam-db-gc-threshold</code> to a high value (such as <code class="code">most-positive-fixnum</code>):
|
||
</p>
|
||
<div class="example lisp">
|
||
<pre class="lisp-preformatted">(setq org-roam-db-gc-threshold most-positive-fixnum)
|
||
</pre></div>
|
||
|
||
<hr>
|
||
</div>
|
||
</div>
|
||
<div class="chapter-level-extent" id="The-Org_002dmode-Ecosystem">
|
||
<div class="nav-panel">
|
||
<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">Org-roam User Manual</a> [<a href="#Keystroke-Index" title="Index" rel="index">Index</a>]</p>
|
||
</div>
|
||
<h2 class="chapter" id="The-Org_002dmode-Ecosystem-1"><span>15 The Org-mode Ecosystem<a class="copiable-link" href="#The-Org_002dmode-Ecosystem-1"> ¶</a></span></h2>
|
||
|
||
<p>Because Org-roam is built on top of Org-mode, it benefits from the vast number
|
||
of packages already available.
|
||
</p>
|
||
|
||
<ul class="mini-toc">
|
||
<li><a href="#Browsing-History-with-winner_002dmode" accesskey="1">Browsing History with winner-mode</a></li>
|
||
<li><a href="#Versioning-Notes" accesskey="2">Versioning Notes</a></li>
|
||
<li><a href="#Full_002dtext-search-with-Deft" accesskey="3">Full-text search with Deft</a></li>
|
||
<li><a href="#Org_002djournal" accesskey="4">Org-journal</a></li>
|
||
<li><a href="#Org_002ddownload" accesskey="5">Org-download</a></li>
|
||
<li><a href="#mathpixel" accesskey="6">mathpix.el</a></li>
|
||
<li><a href="#Org_002dnoter-_002f-Interleave" accesskey="7">Org-noter / Interleave</a></li>
|
||
<li><a href="#Bibliography" accesskey="8">Bibliography</a></li>
|
||
<li><a href="#Spaced-Repetition" accesskey="9">Spaced Repetition</a></li>
|
||
</ul>
|
||
<hr>
|
||
<div class="section-level-extent" id="Browsing-History-with-winner_002dmode">
|
||
<div class="nav-panel">
|
||
<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> [<a href="#Keystroke-Index" title="Index" rel="index">Index</a>]</p>
|
||
</div>
|
||
<h3 class="section" id="Browsing-History-with-winner_002dmode-1"><span>15.1 Browsing History with winner-mode<a class="copiable-link" href="#Browsing-History-with-winner_002dmode-1"> ¶</a></span></h3>
|
||
|
||
<p><code class="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 class="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 class="code">winner-mode</code>. To use <code class="code">winner-mode</code>, simply enable it, and bind the appropriate
|
||
interactive functions:
|
||
</p>
|
||
<div class="example lisp">
|
||
<pre class="lisp-preformatted">(winner-mode +1)
|
||
(define-key winner-mode-map (kbd "<M-left>") #'winner-undo)
|
||
(define-key winner-mode-map (kbd "<M-right>") #'winner-redo)
|
||
|
||
</pre></div>
|
||
|
||
<hr>
|
||
</div>
|
||
<div class="section-level-extent" id="Versioning-Notes">
|
||
<div class="nav-panel">
|
||
<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> [<a href="#Keystroke-Index" title="Index" rel="index">Index</a>]</p>
|
||
</div>
|
||
<h3 class="section" id="Versioning-Notes-1"><span>15.2 Versioning Notes<a class="copiable-link" href="#Versioning-Notes-1"> ¶</a></span></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 class="uref" href="https://git-scm.com/">Git</a>. Simply initialize
|
||
<code class="code">org-roam-directory</code> as a Git repository, and commit your files at regular or
|
||
appropriate intervals. <a class="uref" 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 class="uref" href="https://gitlab.com/pidu/git-timemachine">Git-timemachine</a> allows you to visit historic
|
||
versions of a tracked Org-roam note.
|
||
</p>
|
||
<hr>
|
||
</div>
|
||
<div class="section-level-extent" id="Full_002dtext-search-with-Deft">
|
||
<div class="nav-panel">
|
||
<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> [<a href="#Keystroke-Index" title="Index" rel="index">Index</a>]</p>
|
||
</div>
|
||
<h3 class="section" id="Full_002dtext-search-with-Deft-1"><span>15.3 Full-text search with Deft<a class="copiable-link" href="#Full_002dtext-search-with-Deft-1"> ¶</a></span></h3>
|
||
|
||
<p><a class="uref" href="https://jblevins.org/projects/deft/">Deft</a> provides a nice interface for browsing and filtering org-roam notes.
|
||
</p>
|
||
<div class="example lisp">
|
||
<pre class="lisp-preformatted">(use-package deft
|
||
:after org
|
||
:bind
|
||
("C-c n d" . deft)
|
||
:custom
|
||
(deft-recursive t)
|
||
(deft-use-filter-string-for-filename t)
|
||
(deft-default-extension "org")
|
||
(deft-directory org-roam-directory))
|
||
</pre></div>
|
||
|
||
<p>The Deft interface can slow down quickly when the number of files get huge.
|
||
<a class="uref" href="https://github.com/hasu/notdeft">Notdeft</a> is a fork of Deft that uses an external search engine and indexer.
|
||
</p>
|
||
<hr>
|
||
</div>
|
||
<div class="section-level-extent" id="Org_002djournal">
|
||
<div class="nav-panel">
|
||
<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> [<a href="#Keystroke-Index" title="Index" rel="index">Index</a>]</p>
|
||
</div>
|
||
<h3 class="section" id="Org_002djournal-1"><span>15.4 Org-journal<a class="copiable-link" href="#Org_002djournal-1"> ¶</a></span></h3>
|
||
|
||
<p><a class="uref" 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 class="ref" href="#org_002droam_002ddailies"><code class="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="example lisp">
|
||
<pre class="lisp-preformatted">(use-package org-journal
|
||
:bind
|
||
("C-c n j" . org-journal-new-entry)
|
||
:custom
|
||
(org-journal-date-prefix "#+title: ")
|
||
(org-journal-file-format "%Y-%m-%d.org")
|
||
(org-journal-dir "/path/to/journal/files/")
|
||
(org-journal-date-format "%A, %d %B %Y"))
|
||
</pre></div>
|
||
|
||
<hr>
|
||
</div>
|
||
<div class="section-level-extent" id="Org_002ddownload">
|
||
<div class="nav-panel">
|
||
<p>
|
||
Next: <a href="#mathpixel" accesskey="n" rel="next">mathpix.el</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> [<a href="#Keystroke-Index" title="Index" rel="index">Index</a>]</p>
|
||
</div>
|
||
<h3 class="section" id="Org_002ddownload-1"><span>15.5 Org-download<a class="copiable-link" href="#Org_002ddownload-1"> ¶</a></span></h3>
|
||
|
||
<p><a class="uref" 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 class="image" src="images/org-download.gif" alt="images/org-download">
|
||
<div class="caption"><p><strong class="strong">Figure: </strong>org-download</p></div></div>
|
||
<div class="example lisp">
|
||
<pre class="lisp-preformatted">(use-package org-download
|
||
:after org
|
||
:bind
|
||
(:map org-mode-map
|
||
(("s-Y" . org-download-screenshot)
|
||
("s-y" . org-download-yank))))
|
||
</pre></div>
|
||
|
||
<hr>
|
||
</div>
|
||
<div class="section-level-extent" id="mathpixel">
|
||
<div class="nav-panel">
|
||
<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> [<a href="#Keystroke-Index" title="Index" rel="index">Index</a>]</p>
|
||
</div>
|
||
<h3 class="section" id="mathpix_002eel"><span>15.6 mathpix.el<a class="copiable-link" href="#mathpix_002eel"> ¶</a></span></h3>
|
||
|
||
<p><a class="uref" href="https://github.com/jethrokuan/mathpix.el">mathpix.el</a> uses <a class="uref" href="https://mathpix.com/">Mathpix’s</a> API to convert clips into latex equations:
|
||
</p>
|
||
<div class="float">
|
||
<img class="image" src="images/mathpix.gif" alt="images/mathpix">
|
||
<div class="caption"><p><strong class="strong">Figure: </strong>mathpix</p></div></div>
|
||
<div class="example lisp">
|
||
<pre class="lisp-preformatted">(use-package mathpix.el
|
||
:straight (:host github :repo "jethrokuan/mathpix.el")
|
||
:custom ((mathpix-app-id "app-id")
|
||
(mathpix-app-key "app-key"))
|
||
:bind
|
||
("C-x m" . mathpix-screenshot))
|
||
</pre></div>
|
||
|
||
<hr>
|
||
</div>
|
||
<div class="section-level-extent" id="Org_002dnoter-_002f-Interleave">
|
||
<div class="nav-panel">
|
||
<p>
|
||
Next: <a href="#Bibliography" accesskey="n" rel="next">Bibliography</a>, Previous: <a href="#mathpixel" accesskey="p" rel="prev">mathpix.el</a>, Up: <a href="#The-Org_002dmode-Ecosystem" accesskey="u" rel="up">The Org-mode Ecosystem</a> [<a href="#Keystroke-Index" title="Index" rel="index">Index</a>]</p>
|
||
</div>
|
||
<h3 class="section" id="Org_002dnoter-_002f-Interleave-1"><span>15.7 Org-noter / Interleave<a class="copiable-link" href="#Org_002dnoter-_002f-Interleave-1"> ¶</a></span></h3>
|
||
|
||
<p><a class="uref" href="https://github.com/weirdNox/org-noter">Org-noter</a> and <a class="uref" 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>
|
||
</div>
|
||
<div class="section-level-extent" id="Bibliography">
|
||
<div class="nav-panel">
|
||
<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> [<a href="#Keystroke-Index" title="Index" rel="index">Index</a>]</p>
|
||
</div>
|
||
<h3 class="section" id="Bibliography-1"><span>15.8 Bibliography<a class="copiable-link" href="#Bibliography-1"> ¶</a></span></h3>
|
||
|
||
<p>Org 9.5 added native citation and bibliography functionality, called “org-cite”,
|
||
which org-roam supports.
|
||
</p>
|
||
<p><a class="uref" href="https://github.com/org-roam/org-roam-bibtex">org-roam-bibtex</a> offers tight integration between <a class="uref" href="https://github.com/jkitchin/org-ref">org-ref</a>, <a class="uref" href="https://github.com/tmalsburg/helm-bibtex">helm-bibtex</a> and
|
||
<code class="code">org-roam</code>. This helps you manage your bibliographic notes under <code class="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 <code class="code">ROAM_REFS</code>.
|
||
</p>
|
||
<hr>
|
||
</div>
|
||
<div class="section-level-extent" id="Spaced-Repetition">
|
||
<div class="nav-panel">
|
||
<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> [<a href="#Keystroke-Index" title="Index" rel="index">Index</a>]</p>
|
||
</div>
|
||
<h3 class="section" id="Spaced-Repetition-1"><span>15.9 Spaced Repetition<a class="copiable-link" href="#Spaced-Repetition-1"> ¶</a></span></h3>
|
||
|
||
<p><a class="uref" 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 class="uref" href="https://orgmode.org/worg/org-contrib/org-drill.html">org-drill</a>, and <a class="uref" href="https://github.com/abo-abo/pamparam">pamparam</a>.
|
||
</p>
|
||
<p>To use Anki for spaced repetition, <a class="uref" 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 class="uref" href="https://github.com/FooSoft/anki-connect#installation">anki-connect</a>.
|
||
</p>
|
||
<hr>
|
||
</div>
|
||
</div>
|
||
<div class="chapter-level-extent" id="FAQ">
|
||
<div class="nav-panel">
|
||
<p>
|
||
Next: <a href="#Developer_0027s-Guide-to-Org_002droam" accesskey="n" rel="next">Developer’s Guide to Org-roam</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">Org-roam User Manual</a> [<a href="#Keystroke-Index" title="Index" rel="index">Index</a>]</p>
|
||
</div>
|
||
<h2 class="chapter" id="FAQ-1"><span>16 FAQ<a class="copiable-link" href="#FAQ-1"> ¶</a></span></h2>
|
||
|
||
|
||
<ul class="mini-toc">
|
||
<li><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></li>
|
||
<li><a href="#How-do-I-create-a-note-whose-title-already-matches-one-of-the-candidates_003f" accesskey="2">How do I create a note whose title already matches one of the candidates?</a></li>
|
||
<li><a href="#How-can-I-stop-Org_002droam-from-creating-IDs-everywhere_003f" accesskey="3">How can I stop Org-roam from creating IDs everywhere?</a></li>
|
||
<li><a href="#How-do-I-migrate-from-Roam-Research_003f" accesskey="4">How do I migrate from Roam Research?</a></li>
|
||
<li><a href="#How-to-migrate-from-Org_002droam-v1_003f" accesskey="5">How to migrate from Org-roam v1?</a></li>
|
||
<li><a href="#How-do-I-publish-my-notes-with-an-Internet_002dfriendly-graph_003f" accesskey="6">How do I publish my notes with an Internet-friendly graph?</a></li>
|
||
</ul>
|
||
<hr>
|
||
<div class="section-level-extent" id="How-do-I-have-more-than-one-Org_002droam-directory_003f">
|
||
<div class="nav-panel">
|
||
<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>, Up: <a href="#FAQ" accesskey="u" rel="up">FAQ</a> [<a href="#Keystroke-Index" title="Index" rel="index">Index</a>]</p>
|
||
</div>
|
||
<h3 class="section" id="How-do-I-have-more-than-one-Org_002droam-directory_003f-1"><span>16.1 How do I have more than one Org-roam directory?<a class="copiable-link" href="#How-do-I-have-more-than-one-Org_002droam-directory_003f-1"> ¶</a></span></h3>
|
||
|
||
<p>Emacs supports directory-local variables, allowing the value of
|
||
<code class="code">org-roam-directory</code> to be different in different directories. It does this by
|
||
checking for a file named <code class="code">.dir-locals.el</code>.
|
||
</p>
|
||
<p>To add support for multiple directories, override the <code class="code">org-roam-directory</code>
|
||
variable using directory-local variables. This is what <code class="code">.dir-locals.el</code> may
|
||
contain:
|
||
</p>
|
||
<div class="example lisp">
|
||
<pre class="lisp-preformatted">((nil . ((org-roam-directory . "/path/to/alt/org-roam-dir")
|
||
(org-roam-db-location . "/path/to/alt/org-roam-dir/org-roam.db"))))
|
||
</pre></div>
|
||
|
||
<p>Note <code class="code">org-roam-directory</code> and <code class="code">org-roam-db-location</code> should be an absolute path, not relative.
|
||
</p>
|
||
<p>Alternatively, use <code class="code">eval</code> if you wish to call functions:
|
||
</p>
|
||
<div class="example lisp">
|
||
<pre class="lisp-preformatted">((nil . ((eval . (setq-local
|
||
org-roam-directory (expand-file-name (locate-dominating-file
|
||
default-directory ".dir-locals.el"))))
|
||
(eval . (setq-local
|
||
org-roam-db-location (expand-file-name "org-roam.db"
|
||
org-roam-directory))))))
|
||
</pre></div>
|
||
|
||
<p>All files within that directory will be treated as their own separate set of
|
||
Org-roam files. Remember to run <code class="code">org-roam-db-sync</code> from a file within
|
||
that directory, at least once.
|
||
</p>
|
||
<hr>
|
||
</div>
|
||
<div class="section-level-extent" id="How-do-I-create-a-note-whose-title-already-matches-one-of-the-candidates_003f">
|
||
<div class="nav-panel">
|
||
<p>
|
||
Next: <a href="#How-can-I-stop-Org_002droam-from-creating-IDs-everywhere_003f" accesskey="n" rel="next">How can I stop Org-roam from creating IDs everywhere?</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> [<a href="#Keystroke-Index" title="Index" rel="index">Index</a>]</p>
|
||
</div>
|
||
<h3 class="section" id="How-do-I-create-a-note-whose-title-already-matches-one-of-the-candidates_003f-1"><span>16.2 How do I create a note whose title already matches one of the candidates?<a class="copiable-link" href="#How-do-I-create-a-note-whose-title-already-matches-one-of-the-candidates_003f-1"> ¶</a></span></h3>
|
||
|
||
<p>This situation arises when, for example, one would like to create a note titled
|
||
“bar” when “barricade” already exists.
|
||
</p>
|
||
<p>The solution is dependent on the mini-buffer completion framework in use. Here
|
||
are the solutions:
|
||
</p>
|
||
<dl class="table">
|
||
<dt>Ivy</dt>
|
||
<dd><p>call <code class="code">ivy-immediate-done</code>, typically bound to <code class="code">C-M-j</code>. Alternatively,
|
||
set <code class="code">ivy-use-selectable-prompt</code> to <code class="code">t</code>, so that “bar” is now selectable.
|
||
</p></dd>
|
||
<dt>Helm</dt>
|
||
<dd><p>Org-roam should provide a selectable “[?] bar” candidate at the top of
|
||
the candidate list.
|
||
</p></dd>
|
||
</dl>
|
||
|
||
<hr>
|
||
</div>
|
||
<div class="section-level-extent" id="How-can-I-stop-Org_002droam-from-creating-IDs-everywhere_003f">
|
||
<div class="nav-panel">
|
||
<p>
|
||
Next: <a href="#How-do-I-migrate-from-Roam-Research_003f" accesskey="n" rel="next">How do I migrate from Roam Research?</a>, Previous: <a href="#How-do-I-create-a-note-whose-title-already-matches-one-of-the-candidates_003f" accesskey="p" rel="prev">How do I create a note whose title already matches one of the candidates?</a>, Up: <a href="#FAQ" accesskey="u" rel="up">FAQ</a> [<a href="#Keystroke-Index" title="Index" rel="index">Index</a>]</p>
|
||
</div>
|
||
<h3 class="section" id="How-can-I-stop-Org_002droam-from-creating-IDs-everywhere_003f-1"><span>16.3 How can I stop Org-roam from creating IDs everywhere?<a class="copiable-link" href="#How-can-I-stop-Org_002droam-from-creating-IDs-everywhere_003f-1"> ¶</a></span></h3>
|
||
|
||
<p>Other than the interactive commands that Org-roam provides, Org-roam does not
|
||
create IDs everywhere. If you are noticing that IDs are being created even when
|
||
you don’t want them to be (e.g. when tangling an Org file), check the value you
|
||
have set for <code class="code">org-id-link-to-org-use-id</code>: setting it to <code class="code">'create-if-interactive</code>
|
||
is a popular option.
|
||
</p>
|
||
<hr>
|
||
</div>
|
||
<div class="section-level-extent" id="How-do-I-migrate-from-Roam-Research_003f">
|
||
<div class="nav-panel">
|
||
<p>
|
||
Next: <a href="#How-to-migrate-from-Org_002droam-v1_003f" accesskey="n" rel="next">How to migrate from Org-roam v1?</a>, Previous: <a href="#How-can-I-stop-Org_002droam-from-creating-IDs-everywhere_003f" accesskey="p" rel="prev">How can I stop Org-roam from creating IDs everywhere?</a>, Up: <a href="#FAQ" accesskey="u" rel="up">FAQ</a> [<a href="#Keystroke-Index" title="Index" rel="index">Index</a>]</p>
|
||
</div>
|
||
<h3 class="section" id="How-do-I-migrate-from-Roam-Research_003f-1"><span>16.4 How do I migrate from Roam Research?<a class="copiable-link" href="#How-do-I-migrate-from-Roam-Research_003f-1"> ¶</a></span></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 class="uref" href="https://github.com/fabioberger/roam-migration">in the repository</a>.
|
||
</p>
|
||
<hr>
|
||
</div>
|
||
<div class="section-level-extent" id="How-to-migrate-from-Org_002droam-v1_003f">
|
||
<div class="nav-panel">
|
||
<p>
|
||
Next: <a href="#How-do-I-publish-my-notes-with-an-Internet_002dfriendly-graph_003f" accesskey="n" rel="next">How do I publish my notes with an Internet-friendly graph?</a>, 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> [<a href="#Keystroke-Index" title="Index" rel="index">Index</a>]</p>
|
||
</div>
|
||
<h3 class="section" id="How-to-migrate-from-Org_002droam-v1_003f-1"><span>16.5 How to migrate from Org-roam v1?<a class="copiable-link" href="#How-to-migrate-from-Org_002droam-v1_003f-1"> ¶</a></span></h3>
|
||
|
||
<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, use ‘<samp class="samp">M-x org-roam-migrate-wizard</samp>’.
|
||
<a class="uref" href="https://d12frosted.io/posts/2021-06-11-path-to-org-roam-v2.html">This blog post</a>
|
||
provides a good overview of what’s new in v2 and how to migrate.
|
||
</p>
|
||
<p>Essentially, to migrate notes from v1 to v2, one must:
|
||
</p>
|
||
<ol class="enumerate">
|
||
<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 class="code">#+ROAM_KEY</code> into the <code class="code">ROAM_REFS</code> property
|
||
</li><li> Replace <code class="code">#+ROAM_ALIAS</code> into the <code class="code">ROAM_ALIASES</code> property
|
||
</li><li> Move <code class="code">#+ROAM_TAGS</code> into the <code class="code">#+FILETAGS</code> property for file-level nodes,
|
||
and the <code class="code">ROAM_TAGS</code> property for headline nodes
|
||
</li><li> Replace existing file links with ID links.
|
||
</li></ol>
|
||
|
||
<hr>
|
||
</div>
|
||
<div class="section-level-extent" id="How-do-I-publish-my-notes-with-an-Internet_002dfriendly-graph_003f">
|
||
<div class="nav-panel">
|
||
<p>
|
||
Previous: <a href="#How-to-migrate-from-Org_002droam-v1_003f" accesskey="p" rel="prev">How to migrate from Org-roam v1?</a>, Up: <a href="#FAQ" accesskey="u" rel="up">FAQ</a> [<a href="#Keystroke-Index" title="Index" rel="index">Index</a>]</p>
|
||
</div>
|
||
<h3 class="section" id="How-do-I-publish-my-notes-with-an-Internet_002dfriendly-graph_003f-1"><span>16.6 How do I publish my notes with an Internet-friendly graph?<a class="copiable-link" href="#How-do-I-publish-my-notes-with-an-Internet_002dfriendly-graph_003f-1"> ¶</a></span></h3>
|
||
|
||
<p>The default graph builder creates a graph with an <a class="uref" href="https://orgmode.org/worg/org-contrib/org-protocol.html">org-protocol</a>
|
||
handler which is convenient when you’re working locally but
|
||
inconvenient when you want to publish your notes for remote access.
|
||
Likewise, it defaults to displaying the graph in Emacs which has the
|
||
exact same caveats. This problem is solvable in the following way
|
||
using org-mode’s native <a class="uref" href="https://orgmode.org/manual/Publishing.html">publishing</a> capability:
|
||
</p>
|
||
<ol class="enumerate">
|
||
<li> configure org-mode to publish your org-roam notes as a project.
|
||
</li><li> create a function that overrides the default org-protocol link
|
||
creation function(‘<samp class="samp">org-roam-default-link-builder</samp>’).
|
||
</li><li> create a hook that’s called at the end of graph creation to copy
|
||
the generated graph to the appropriate place.
|
||
</li></ol>
|
||
|
||
<p>The example code below is used to publish to a local directory where a
|
||
separate shell script copies the files to the remote site.
|
||
</p>
|
||
|
||
<ul class="mini-toc">
|
||
<li><a href="#Configure-org_002dmode-for-publishing" accesskey="1">Configure org-mode for publishing</a></li>
|
||
<li><a href="#Overriding-the-default-link-creation-function" accesskey="2">Overriding the default link creation function</a></li>
|
||
<li><a href="#Copying-the-generated-file-to-the-export-directory" accesskey="3">Copying the generated file to the export directory</a></li>
|
||
</ul>
|
||
<hr>
|
||
<div class="subsection-level-extent" id="Configure-org_002dmode-for-publishing">
|
||
<div class="nav-panel">
|
||
<p>
|
||
Next: <a href="#Overriding-the-default-link-creation-function" accesskey="n" rel="next">Overriding the default link creation function</a>, Up: <a href="#How-do-I-publish-my-notes-with-an-Internet_002dfriendly-graph_003f" accesskey="u" rel="up">How do I publish my notes with an Internet-friendly graph?</a> [<a href="#Keystroke-Index" title="Index" rel="index">Index</a>]</p>
|
||
</div>
|
||
<h4 class="subsection" id="Configure-org_002dmode-for-publishing-1"><span>16.6.1 Configure org-mode for publishing<a class="copiable-link" href="#Configure-org_002dmode-for-publishing-1"> ¶</a></span></h4>
|
||
|
||
<p>This has two steps:
|
||
</p><ol class="enumerate">
|
||
<li> Setting of a <em class="emph">roam</em> project that publishes your notes.
|
||
</li><li> Configuring the <em class="emph">sitemap.html</em> generation.
|
||
</li><li> Setting up ‘<samp class="samp">org-publish</samp>’ to generate the graph.
|
||
</li></ol>
|
||
|
||
<p>This will require code like the following:
|
||
</p><div class="example lisp">
|
||
<pre class="lisp-preformatted">(defun roam-sitemap (title list)
|
||
(concat "#+OPTIONS: ^:nil author:nil html-postamble:nil\n"
|
||
"#+SETUPFILE: ./simple_inline.theme\n"
|
||
"#+TITLE: " title "\n\n"
|
||
(org-list-to-org list) "\nfile:sitemap.svg"))
|
||
|
||
(setq my-publish-time 0) ; see the next section for context
|
||
(defun roam-publication-wrapper (plist filename pubdir)
|
||
(org-roam-graph)
|
||
(org-html-publish-to-html plist filename pubdir)
|
||
(setq my-publish-time (cadr (current-time))))
|
||
|
||
(setq org-publish-project-alist
|
||
'(("roam"
|
||
:base-directory "~/roam"
|
||
:auto-sitemap t
|
||
:sitemap-function roam-sitemap
|
||
:sitemap-title "Roam notes"
|
||
:publishing-function roam-publication-wrapper
|
||
:publishing-directory "~/roam-export"
|
||
:section-number nil
|
||
:table-of-contents nil
|
||
:style "<link rel=\"stylesheet\" href=\"../other/mystyle.cs\" type=\"text/css\">")))
|
||
</pre></div>
|
||
|
||
<hr>
|
||
</div>
|
||
<div class="subsection-level-extent" id="Overriding-the-default-link-creation-function">
|
||
<div class="nav-panel">
|
||
<p>
|
||
Next: <a href="#Copying-the-generated-file-to-the-export-directory" accesskey="n" rel="next">Copying the generated file to the export directory</a>, Previous: <a href="#Configure-org_002dmode-for-publishing" accesskey="p" rel="prev">Configure org-mode for publishing</a>, Up: <a href="#How-do-I-publish-my-notes-with-an-Internet_002dfriendly-graph_003f" accesskey="u" rel="up">How do I publish my notes with an Internet-friendly graph?</a> [<a href="#Keystroke-Index" title="Index" rel="index">Index</a>]</p>
|
||
</div>
|
||
<h4 class="subsection" id="Overriding-the-default-link-creation-function-1"><span>16.6.2 Overriding the default link creation function<a class="copiable-link" href="#Overriding-the-default-link-creation-function-1"> ¶</a></span></h4>
|
||
|
||
<p>The code below will generate a link to the generated html file instead
|
||
of the default org-protocol link.
|
||
</p><div class="example lisp">
|
||
<pre class="lisp-preformatted">(defun org-roam-custom-link-builder (node)
|
||
(let ((file (org-roam-node-file node)))
|
||
(concat (file-name-base file) ".html")))
|
||
|
||
(setq org-roam-graph-link-builder 'org-roam-custom-link-builder)
|
||
</pre></div>
|
||
|
||
<hr>
|
||
</div>
|
||
<div class="subsection-level-extent" id="Copying-the-generated-file-to-the-export-directory">
|
||
<div class="nav-panel">
|
||
<p>
|
||
Previous: <a href="#Overriding-the-default-link-creation-function" accesskey="p" rel="prev">Overriding the default link creation function</a>, Up: <a href="#How-do-I-publish-my-notes-with-an-Internet_002dfriendly-graph_003f" accesskey="u" rel="up">How do I publish my notes with an Internet-friendly graph?</a> [<a href="#Keystroke-Index" title="Index" rel="index">Index</a>]</p>
|
||
</div>
|
||
<h4 class="subsection" id="Copying-the-generated-file-to-the-export-directory-1"><span>16.6.3 Copying the generated file to the export directory<a class="copiable-link" href="#Copying-the-generated-file-to-the-export-directory-1"> ¶</a></span></h4>
|
||
|
||
<p>The default behavior of ‘<samp class="samp">org-roam-graph</samp>’ is to generate the graph and
|
||
display it in Emacs. There is an ‘<samp class="samp">org-roam-graph-generation-hook</samp>’
|
||
available that provides access to the file names so they can be copied
|
||
to the publishing directory. Example code follows:
|
||
</p>
|
||
<div class="example lisp">
|
||
<pre class="lisp-preformatted">(add-hook 'org-roam-graph-generation-hook
|
||
(lambda (dot svg) (if (< (- (cadr (current-time)) my-publish-time) 5)
|
||
(progn (copy-file svg "~/roam-export/sitemap.svg" 't)
|
||
(kill-buffer (file-name-nondirectory svg))
|
||
(setq my-publish-time 0)))))
|
||
</pre></div>
|
||
|
||
<hr>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<div class="chapter-level-extent" id="Developer_0027s-Guide-to-Org_002droam">
|
||
<div class="nav-panel">
|
||
<p>
|
||
Next: <a href="#Appendix" accesskey="n" rel="next">Appendix</a>, Previous: <a href="#FAQ" accesskey="p" rel="prev">FAQ</a>, Up: <a href="#Top" accesskey="u" rel="up">Org-roam User Manual</a> [<a href="#Keystroke-Index" title="Index" rel="index">Index</a>]</p>
|
||
</div>
|
||
<h2 class="chapter" id="Developer_0027s-Guide-to-Org_002droam-1"><span>17 Developer’s Guide to Org-roam<a class="copiable-link" href="#Developer_0027s-Guide-to-Org_002droam-1"> ¶</a></span></h2>
|
||
|
||
|
||
<ul class="mini-toc">
|
||
<li><a href="#Org_002droam_0027s-Design-Principle" accesskey="1">Org-roam’s Design Principle</a></li>
|
||
<li><a href="#Building-Extensions-and-Advanced-Customization-of-Org_002droam" accesskey="2">Building Extensions and Advanced Customization of Org-roam</a></li>
|
||
</ul>
|
||
<hr>
|
||
<div class="section-level-extent" id="Org_002droam_0027s-Design-Principle">
|
||
<div class="nav-panel">
|
||
<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> [<a href="#Keystroke-Index" title="Index" rel="index">Index</a>]</p>
|
||
</div>
|
||
<h3 class="section" id="Org_002droam_0027s-Design-Principle-1"><span>17.1 Org-roam’s Design Principle<a class="copiable-link" href="#Org_002droam_0027s-Design-Principle-1"> ¶</a></span></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’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 class="itemize mark-bullet">
|
||
<li>link graph traversal and visualization
|
||
</li><li>Instantaneous SQL-like queries on headlines
|
||
<ul class="itemize mark-bullet">
|
||
<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’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>
|
||
</div>
|
||
<div class="section-level-extent" id="Building-Extensions-and-Advanced-Customization-of-Org_002droam">
|
||
<div class="nav-panel">
|
||
<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> [<a href="#Keystroke-Index" title="Index" rel="index">Index</a>]</p>
|
||
</div>
|
||
<h3 class="section" id="Building-Extensions-and-Advanced-Customization-of-Org_002droam-1"><span>17.2 Building Extensions and Advanced Customization of Org-roam<a class="copiable-link" href="#Building-Extensions-and-Advanced-Customization-of-Org_002droam-1"> ¶</a></span></h3>
|
||
|
||
<p>Because Org-roam’s core functionality is small, it is possible and sometimes
|
||
desirable to build extensions on top of it. These extensions may use one or more of
|
||
the following functionalities:
|
||
</p>
|
||
<ul class="itemize mark-bullet">
|
||
<li>Access to Org-roam’s database
|
||
</li><li>Usage/modification of Org-roam’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>
|
||
<ol class="enumerate">
|
||
<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 class="code">org-roam-db-version</code>), and only conditionally
|
||
load when support is available.
|
||
</li></ol>
|
||
|
||
|
||
<ul class="mini-toc">
|
||
<li><a href="#Accessing-the-Database" accesskey="1">Accessing the Database</a></li>
|
||
<li><a href="#Accessing-and-Modifying-Nodes" accesskey="2">Accessing and Modifying Nodes</a></li>
|
||
<li><a href="#Extending-the-Capture-System" accesskey="3">Extending the Capture System</a></li>
|
||
</ul>
|
||
<hr>
|
||
<div class="subsection-level-extent" id="Accessing-the-Database">
|
||
<div class="nav-panel">
|
||
<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> [<a href="#Keystroke-Index" title="Index" rel="index">Index</a>]</p>
|
||
</div>
|
||
<h4 class="subsection" id="Accessing-the-Database-1"><span>17.2.1 Accessing the Database<a class="copiable-link" href="#Accessing-the-Database-1"> ¶</a></span></h4>
|
||
|
||
<p>Access to the database is provided singularly by <code class="code">org-roam-db-query</code>, for
|
||
example:
|
||
</p>
|
||
<div class="example lisp">
|
||
<pre class="lisp-preformatted">(org-roam-db-query [:select * :from nodes])
|
||
</pre></div>
|
||
|
||
<p>One can refer to the database schema by looking up
|
||
<code class="code">org-roam-db--table-schemata</code>. There are multiple helper functions within
|
||
Org-roam that call <code class="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 class="code">org-roam-db-query</code>, and perhaps replicate the SQL query if necessary.
|
||
</p>
|
||
<hr>
|
||
</div>
|
||
<div class="subsection-level-extent" id="Accessing-and-Modifying-Nodes">
|
||
<div class="nav-panel">
|
||
<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> [<a href="#Keystroke-Index" title="Index" rel="index">Index</a>]</p>
|
||
</div>
|
||
<h4 class="subsection" id="Accessing-and-Modifying-Nodes-1"><span>17.2.2 Accessing and Modifying Nodes<a class="copiable-link" href="#Accessing-and-Modifying-Nodes-1"> ¶</a></span></h4>
|
||
|
||
<p>The node interface is cleanly defined using <code class="code">cl-defstruct</code>. The primary
|
||
method to access nodes is <code class="code">org-roam-node-at-point</code> and <code class="code">org-roam-node-read</code>:
|
||
</p>
|
||
<ul class="itemize mark-bullet">
|
||
<li>Function: org-roam-node-at-point &optional assert
|
||
|
||
<p>Return the node at point. If ASSERT, throw an error if there is no node at
|
||
point.
|
||
</p>
|
||
</li><li>Function: org-roam-node-read &optional initial-input filter-fn sort-fn
|
||
require-match
|
||
|
||
<p>Read and return an ‘org-roam-node’.
|
||
INITIAL-INPUT is the initial minibuffer prompt value. FILTER-FN
|
||
is a function to filter out nodes: it takes a single argument (an
|
||
<code class="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 class="code">org-roam-node-read-sort-by-file-mtime</code>
|
||
for an example sort function.
|
||
If REQUIRE-MATCH, the minibuffer prompt will require a match.
|
||
</p></li></ul>
|
||
|
||
<p>Once you obtain the node, you can use the accessors for the node, e.g.
|
||
<code class="code">org-roam-node-id</code> or <code class="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 class="code">cl-defmethod</code> on the <code class="code">org-roam-node</code> struct:
|
||
</p>
|
||
<div class="example lisp">
|
||
<pre class="lisp-preformatted">(cl-defmethod org-roam-node-namespace ((node org-roam-node))
|
||
"Return the namespace for NODE.
|
||
The namespace is the final directory of the file for the node."
|
||
(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 class="code">namespace</code> on <code class="code">org-roam-node</code>, which
|
||
making it available for use in capture templates.
|
||
</p>
|
||
<hr>
|
||
</div>
|
||
<div class="subsection-level-extent" id="Extending-the-Capture-System">
|
||
<div class="nav-panel">
|
||
<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> [<a href="#Keystroke-Index" title="Index" rel="index">Index</a>]</p>
|
||
</div>
|
||
<h4 class="subsection" id="Extending-the-Capture-System-1"><span>17.2.3 Extending the Capture System<a class="copiable-link" href="#Extending-the-Capture-System-1"> ¶</a></span></h4>
|
||
|
||
<p>Org-roam applies some patching over Org’s capture system to smooth out the user
|
||
experience, and sometimes it is desirable to use Org-roam’s capturing system
|
||
instead. The exposed function to be used in extensions is <code class="code">org-roam-capture-</code>:
|
||
</p>
|
||
<ul class="itemize mark-bullet">
|
||
<li>Function: org-roam-capture- &key goto keys node info props templates
|
||
|
||
<p>Main entry point.
|
||
GOTO and KEYS correspond to ‘org-capture’ arguments.
|
||
INFO is a plist for filling up Org-roam’s capture templates.
|
||
NODE is an ‘org-roam-node’ 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></li></ul>
|
||
|
||
<p>An example of an extension using <code class="code">org-roam-capture-</code> is <code class="code">org-roam-dailies</code>
|
||
itself:
|
||
</p>
|
||
<div class="example lisp">
|
||
<pre class="lisp-preformatted">(defun org-roam-dailies--capture (time &optional goto)
|
||
"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."
|
||
(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>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<div class="chapter-level-extent" id="Appendix">
|
||
<div class="nav-panel">
|
||
<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">Org-roam User Manual</a> [<a href="#Keystroke-Index" title="Index" rel="index">Index</a>]</p>
|
||
</div>
|
||
<h2 class="chapter" id="Appendix-1"><span>18 Appendix<a class="copiable-link" href="#Appendix-1"> ¶</a></span></h2>
|
||
|
||
|
||
<ul class="mini-toc">
|
||
<li><a href="#Note_002dtaking-Workflows" accesskey="1">Note-taking Workflows</a></li>
|
||
<li><a href="#Ecosystem" accesskey="2">Ecosystem</a></li>
|
||
</ul>
|
||
<hr>
|
||
<div class="section-level-extent" id="Note_002dtaking-Workflows">
|
||
<div class="nav-panel">
|
||
<p>
|
||
Next: <a href="#Ecosystem" accesskey="n" rel="next">Ecosystem</a>, Up: <a href="#Appendix" accesskey="u" rel="up">Appendix</a> [<a href="#Keystroke-Index" title="Index" rel="index">Index</a>]</p>
|
||
</div>
|
||
<h3 class="section" id="Note_002dtaking-Workflows-1"><span>18.1 Note-taking Workflows<a class="copiable-link" href="#Note_002dtaking-Workflows-1"> ¶</a></span></h3>
|
||
|
||
<dl class="table">
|
||
<dt>Books</dt>
|
||
<dd><ul class="itemize mark-bullet">
|
||
<li><a class="uref" href="https://www.goodreads.com/book/show/34507927-how-to-take-smart-notes">How To Take Smart Notes</a>
|
||
</li></ul>
|
||
</dd>
|
||
<dt>Articles</dt>
|
||
<dd><ul class="itemize mark-bullet">
|
||
<li><a class="uref" href="https://www.lesswrong.com/posts/NfdHG6oHBJ8Qxc26s/the-zettelkasten-method-1">The Zettelkasten Method - LessWrong 2.0</a>
|
||
</li><li><a class="uref" href="https://reddit.com/r/RoamResearch/comments/eho7de/building_a_second_brain_in_roamand_why_you_might">Building a Second Brain in Roam…And Why You Might Want To : RoamResearch</a>
|
||
</li><li><a class="uref" href="https://www.nateliason.com/blog/roam">Roam Research: Why I Love It and How I Use It - Nat Eliason</a>
|
||
</li><li><a class="uref" href="https://twitter.com/adam_keesling/status/1196864424725774336?s=20">Adam Keesling’s Twitter Thread</a>
|
||
</li><li><a class="uref" 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>
|
||
</dd>
|
||
<dt>Threads</dt>
|
||
<dd><ul class="itemize mark-bullet">
|
||
<li><a class="uref" href="https://news.ycombinator.com/item?id=22473209">Ask HN: How to Take Good Notes</a>
|
||
</li></ul>
|
||
</dd>
|
||
<dt>Videos</dt>
|
||
<dd><ul class="itemize mark-bullet">
|
||
<li><a class="uref" href="https://www.youtube.com/watch?v=RvWic15iXjk">How to Use Roam to Outline a New Article in Under 20 Minutes</a>
|
||
</li></ul>
|
||
</dd>
|
||
</dl>
|
||
|
||
<hr>
|
||
</div>
|
||
<div class="section-level-extent" id="Ecosystem">
|
||
<div class="nav-panel">
|
||
<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> [<a href="#Keystroke-Index" title="Index" rel="index">Index</a>]</p>
|
||
</div>
|
||
<h3 class="section" id="Ecosystem-1"><span>18.2 Ecosystem<a class="copiable-link" href="#Ecosystem-1"> ¶</a></span></h3>
|
||
|
||
<hr>
|
||
</div>
|
||
</div>
|
||
<div class="appendix-level-extent" id="Keystroke-Index">
|
||
<div class="nav-panel">
|
||
<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">Org-roam User Manual</a> [<a href="#Keystroke-Index" title="Index" rel="index">Index</a>]</p>
|
||
</div>
|
||
<h2 class="appendix" id="Keystroke-Index-1"><span>Appendix A Keystroke Index<a class="copiable-link" href="#Keystroke-Index-1"> ¶</a></span></h2>
|
||
|
||
|
||
<hr>
|
||
</div>
|
||
<div class="appendix-level-extent" id="Command-Index">
|
||
<div class="nav-panel">
|
||
<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">Org-roam User Manual</a> [<a href="#Keystroke-Index" title="Index" rel="index">Index</a>]</p>
|
||
</div>
|
||
<h2 class="appendix" id="Command-Index-1"><span>Appendix B Command Index<a class="copiable-link" href="#Command-Index-1"> ¶</a></span></h2>
|
||
|
||
|
||
<hr>
|
||
</div>
|
||
<div class="appendix-level-extent" id="Function-Index">
|
||
<div class="nav-panel">
|
||
<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">Org-roam User Manual</a> [<a href="#Keystroke-Index" title="Index" rel="index">Index</a>]</p>
|
||
</div>
|
||
<h2 class="appendix" id="Function-Index-1"><span>Appendix C Function Index<a class="copiable-link" href="#Function-Index-1"> ¶</a></span></h2>
|
||
|
||
|
||
<hr>
|
||
</div>
|
||
<div class="appendix-level-extent" id="Variable-Index">
|
||
<div class="nav-panel">
|
||
<p>
|
||
Previous: <a href="#Function-Index" accesskey="p" rel="prev">Function Index</a>, Up: <a href="#Top" accesskey="u" rel="up">Org-roam User Manual</a> [<a href="#Keystroke-Index" title="Index" rel="index">Index</a>]</p>
|
||
</div>
|
||
<h2 class="appendix" id="Variable-Index-1"><span>Appendix D Variable Index<a class="copiable-link" href="#Variable-Index-1"> ¶</a></span></h2>
|
||
|
||
|
||
<p>Emacs 30.1 (Org mode 9.7.29)
|
||
</p></div>
|
||
</div>
|
||
<div class="footnotes-segment">
|
||
<hr>
|
||
<h4 class="footnotes-heading">Footnotes</h4>
|
||
|
||
<h5 class="footnote-body-heading"><a id="FOOT1" href="#DOCF1">(1)</a></h5>
|
||
<p>To understand more about Roam, a collection of links are available in <a class="ref" href="#Note_002dtaking-Workflows">Note-taking Workflows</a>.</p>
|
||
</div>
|
||
|
||
|
||
|
||
</body>
|
||
</html>
|