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.
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 "./"))))))
Makes org-roam-mode a global minor mode. This mode adds an advice to find-file-function, which decides whether to turn on the local post-command-hook and after-save-hook.
It also advices delete-file and rename-file to ensure cache consistency. Also fixes a bug introduced with #142