felko / neuron-mode

An emacs mode for editing Zettelkasten notes with neuron
GNU General Public License v3.0
119 stars 21 forks source link

org-roam export #18

Closed ghost closed 4 years ago

ghost commented 4 years ago

I use org-roam to manage my Zettelkasten. Neuron seems like the best tool for rendering a subset of it as HTML. It seems like the missing piece is an Org -> Markdown export that generates Neuron-compatible links from the org-roam links.

The org-roam links look like:

[[file:../example-node.org][Link Text]]

Where the linked file generally has an org title annotation:

#+TITLE: Example Node

Seems like if the export generated a link like

[Link Text](z://example-node)

then the resulting markdown might work with Neuron. Is the numeric link id required for Neuron, or just a convention?

With this export in place, I'd combine it with the org-roam Roam importer to fully migrate off Roam for personal Zettels. FWIW Roam is still great for collaborative Zettelling.

felko commented 4 years ago

The numeric ID is the default and recommended ID format for all zettels, since it allows links to be displayed as dates, but all alphanumeric IDs are supported by neuron, so conversion should be possible. Alternatively file metadata could be used to recover the date of creation of the file and generate an ID for that day.

However, neuron doesn't allow custom link text because links are supposed to be uniform and display the exact title of the linked zettel, that's why the current syntax is [id](z:/some-ignored-text), though that's going to change in https://github.com/srid/neuron/issues/59 but I don't think that link text will ever be supported.

An ad-hoc solution could be to convert links like [[file:../title.org][link text]] to link text (see <title>) which should output a readable sentence in most cases.

The good news is that neuron is eventually going to use pandoc (see https://github.com/srid/neuron/issues/137) which will make this kind of migration script relatively easy to implement in Haskell, by using neuron as a library.

Anyway I'm closing this because I don't think this kind of thing is within the scope of neuron-mode, but that's definitely a good idea, as org-roam is one of the most used tools for managing zettelkastens AFAIK.