Instead of implementing our own templating system, we abuse org-capture's templating system. We add 2 additional properties:
- :head: a starting template that goes at the beginning of the file.
- :file-name: a string that expands to the file name
The templates are customizable at `org-roam-capture-templates` and `org-roam-ref-capture-templates`.
The graphname is displayed as tooltip when hovering over non-node
areas in the SVG viewer.
When grahname is undefined Chrome and Firefox just displays
"%3" (ETX/End of Text).
`org-roam-build-cache` takes very little time, when the cache is
already built running it on `org-roam-mode` ensures that the cache is
consistent with the files.
Add 2 custom handlers:
1. roam-file?file=path: this simply opens the file at path in Emacs.
2. roam-ref?ref=ref&template=roam-template&title=title&...: attempts to open a roam note with a given ROAM_KEY. If the note doesn't exist, create one. Else, open it.
All org-roam related information will now be stored in the database. Henceforth, the cache needs to be built synchronously once (via `M-x org-roam-build-cache`), which is then incrementally updated.
We emulate org-protocol, and advise server-find-files, stripping the
roam protocol from the filename. This reduces the setup required to
open `roam://` links.
Prevent needless repeated calls to org-roam-directory-normalized by having a
reference to the cache object that matches the local buffer.
Co-authored-by: Jethro Kuan <jethrokuan95@gmail.com>
Each org-roam-directory gets its own cache. One can override the `org-roam-directory` variable locally via dir-locals:
((org-mode . ((eval . (setq-local org-roam-directory (expand-file-name "./"))))))
Ref #158
Example output:
(mapcar #'org-roam--title-to-slug
'("!!!!Org-Roam is great!!!!"
"Sobre a formação dos planetas"
"1\\2.3///**"
"10-2+3=45"))
;; ("org_roam_is_great" "sobre_a_formação_dos_planetas" "1_2_3" "10_2_3_45")
* (feature): add custom font styling for org-roam links
This adds 'org-roam-link-face. When org-roam-mode is on, all roam
links take this face. By default, it is exactly the same as 'org-link,
and would require styling.
* update docs