Solving the Denote/Gollum links quandary
My whole “thing I wish Denote would just do” issue has been around its custom linking format: If you use Denote’s kind of awesome org-mode dblocks, you get denote:
formatted links. Prot is very careful to say custom links are perfectly legal and supported by Emacs, but that leaves out the reality that there’s an ecosystem of non-Emacs org-mode tools (e.g. Plain Org) that don’t understand custom link formats.
So I had this very cool thing going on with Gollum running on my Synology. Gollum is mostly the same engine GitHub uses for its own wikis, and it can understand a variety of plaintext formats (including Markdown and org). With Gollum you’ve got a web front-end with search, version control, and inline editing if you’re away from an Emacs-capable machine or just want to look a note up on a phone.
And Denote has its very cool org-mode dblocks: You can use a regexp to pull files matching a certain pattern into a dynamically updating block to create things the Zettelkasten folks might call a MOC, Prot refers to as “metanotes,” etc. I have made a set of index files on high-level areas I tagged with “topic,” so a Denote dblock with this syntax:
1#+BEGIN: denote-links :regexp "_topic" :not-regexp nil :excluded-dirs-regexp nil :sort-by-component nil :reverse-sort nil :id-only nil :include-date nil
… will dynamically create an index of links to all my “topic” notes, and within each of them I can make Denote dblocks that pull in notes with their tag.
In the context of Gollum, or even just an entry point into my notes collection, that means my Home page can provide a dynamic index of topic notes as I create them. Except, of course, the whole problem that a Denote dblock uses its custom denote:
link scheme, and Gollum can’t understand that.
You can manually use Denote’s denote-org-convert-links-to-file-type
command to convert those links to standard file:
links, but I’m forgetful and hate the thought of having to remember to do it. So I fixed it with a .dir-locals.el
file that does it for me with a pre-save hook:
1((org-mode . ((eval . (add-hook 'before-save-hook
2 #'denote-org-convert-links-to-file-type
3 nil t)))))
So I can update my topic pages, save them, the hook runs for me, and I can push into the Gollum repo. I get to keep all of Denote’s convenience features around link-making, backlink lists, etc, and Gollum knows what to do with it all.