-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
org-mode integration #26
Comments
The bulk of the work for this needs to be done in neuron. neuron parseMarkdown :: YAML.FromYAML meta => FilePath -> Text -> Either Text (meta, Pandoc) Basically have a |
Yeah, I'm planning on implementing org support for neuron, I already managed to get neuron generate HTML from org files (just as a quick test), the only thing left to do is to process zettel links. On the emacs side, I'm not sure if it would require any major mode on top of org-mode, since org-mode is already configurable enough to make it pretty much as easy to use as neuron-mode, I'll try to come up with an org config that integrates neuron links using custom link types. Combined with deft, we would get all the major features of neuron-mode in org-mode (in this repo?). |
I believe regular links with the same link text as URL, like the below, will produce the pandoc AST that neuron will process as zettel links.
However, this might be unnecessarily verbose repetitive. In markdown one can do |
I think we can do |
After seeing multiple people "complaining" about neuron-mode not being available for org notes, I realize that maybe neuron-mode should be a minor mode. Most of the code is merely bridging emacs with the neuron CLI app, I think I could extract this part to a format-agnostic library, and provide minor modes for functions that require parsing links, adding tags, etc... |
Ideally the ID facility of Org mode would be used for this. There are some caveats left in Org itself to support this well though. It for example relies on a global configuration file to keep track of ID's. The benefit would be that filenames and links can be decoupled, and that links will work in vanilla Org mode. |
Thanks, I was just looking at the options org mode had for this kind of link (cf. srid/neuron#263)
There is not fundamental issue with that but neuron uses IDs for the zettels filenames. I think it would be preferable to have a uniform treatment of IDs between all note formats. My current attempt at gluing neuron and org is this: (defun org-follow-neuron-query (path arg)
(neuron--follow-query
(neuron--parse-query-from-url-or-id
(concat "z:" path))))
(defun org-complete-neuron-link (&rest arg)
(alist-get 'id (neuron-select-zettel)))
(defun org-activate-neuron-link (beg end path brackets)
(let ((ov (make-overlay beg end nil t nil))
(query (neuron--parse-query-from-url-or-id (concat "z:" path))))
(neuron--setup-overlay-from-query ov query)))
(org-link-set-parameters "z" :follow #'org-follow-neuron-query
:complete #'org-complete-neuron-link
:activate-func #'org-activate-neuron-link) which makes neuron links look like Edit: Turns out Pandoc does support angle links but I haven't been able to get them to parse |
Tbh, it's probably easier to create neuron-specific links than to reuse existing link-types. My angle only is that it would be nice if org mode internals could be reused as much as possible. But the concept of query-links that Neuron has doesn't exist in Org, so for that to go into Org mode core something new would need to be developed anyways. To write a few words about ID links since you asked: They depend on ID's being added to files or headlines within property-drawers. A node (file or headline) with such an ID can be linked to using ID-links. It uses a separate metadata file to keep track of ID locations, and with the information in that file, links work across the filesystem. But as you say, for Neuron queries and tag searches they probably won't do much good. And since ID links aren't really bound to only files they might map poorly to the design of Neuron. To connect to thoughts about z-links, maybe there should be separate link types for zettels, for link-queries?. [[z:...]] and [[z/query:...]] for example? z-links would be as sugar around regular file-links, but limited to the Neuron context I suppose? (z-links is kind of what I hoped ID could be used for, but there are as discussed some limitations). z/query would be something else though, since that possibly could link to 0-many other zettels? |
Thanks a lot for the explanation, indeed I'm not sure ID links fit nicely into neuron's design.
I don't think that's an issue, I managed to get neuron to understand query links from org and tell org-mode to trigger I considered separating single zettel links from queries but the link syntax should be made as uniform as possible in any format. I'm also considering the possibility to let org zettels manage how they are generated in HTML using the export framework. Anyway, it'll take me some time to wrap my head around org-mode, so I'll settle for |
srid/neuron#263 has been merged and adds support for org-mode notes in Neuron. |
Really rough implementation that seems to do the job
|
Thanks a lot. I still have to figure out exactly how neuron-mode as a minor mode will affect the features. I might need to release a v1.0 with the current features and work on the new version, which probably will introduce a lot of breaking change in people's configs. |
Yeah, I'm currently not using |
Were you able to make any further progress? I read somewhere that you were thinking of using org-mode personally with neuron. If you are, how are you handling it now? |
No progress unfortunately, sorry. I've been busy with school recently. |
Hi there!
Thanks for all of the effort on this project so far. This is the only emacs zettelkasten I've got to work out of the box.
One feature that I think might be missing, or maybe it is simply a matter of explaining in the docs, is how to use org-mode with neuron-mode.
The reason I bring this up is that of course emacs users tend to love org-mode, and this was one attractive quality of this project as well:
https://www.eliasstorms.net/zetteldeft/
The text was updated successfully, but these errors were encountered: