Skip to content
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

Add denote link type #129

Open
jarofromel opened this issue Jan 2, 2025 · 2 comments
Open

Add denote link type #129

jarofromel opened this issue Jan 2, 2025 · 2 comments
Labels
enhancement New feature or request

Comments

@jarofromel
Copy link

Hello,
I use denote (note-taking approach in emacs) which uses its own link type.
The notes (files) have file-naming scheme -> 20200927T000622--awk-learning-sources.org.
The link to this file is [[denote:20200927T000622][awk learning sources]], so it is like the file type link but only the first part (yyyymmddThhmmss) is used in the link.
Also the link can contain heading part -> [denote:20200927T000622::*heading] or [denote:20200927T000622::#CUSTOM-ID].

I understand that adding custom link types besides org ones is extra work. My arguments are that Denote with Org-roam are probably most popular note-taking packages (in Emacs ecosystem), and maybe that implementation would be similar to file link type (my guess).

Thank for potentially considering this issue. Also thanks for very useful app it helps a lot with using my notes in Android.

@amake
Copy link
Owner

amake commented Jan 2, 2025

Some issues I see:

  • Orgro will not know how to resolve denote-directory. If it is a flat directory and the current document is inside denote-directory then it will just be ./, but any other cases are unclear.
  • To compute the actual filename it looks like I would have to completely reimplement the sluggification logic
  • Even with all of the above solved, there are numerous ways to customize the mapping between link and filename (signatures, denote-file-name-components-order, etc.). All of this would need to be reimplemented.

Supporting all of this would be outside of Orgro's remit. If there is a reasonable subset then I might consider it, if it would be of significant value to users.

@amake
Copy link
Owner

amake commented Jan 2, 2025

Denote's core link-resolving logic requires recursively iterating over all files in denote-directory looking for the one with the portion considered an ID.

  denote--directory-all-files-recursively()
  denote--directory-get-files()
  denote-directory-files()
  denote-get-path-by-id("20250103T082129")
  denote-link--ol-resolve-link-to-target("20250103T082129::#h:9B4FF9B7-4BA2-4B09-84F1-907A2AB35BD4")
  (org-link-open-as-file (denote-link--ol-resolve-link-to-target link) nil)
  denote-link-ol-follow("20250103T082129::#h:9B4FF9B7-4BA2-4B09-84F1-907A2AB35BD4")
  org-link-open((link (:standard-properties [116 nil 183 197 199 0 nil nil nil nil nil nil nil nil #<buffer 20250103T082153--another-test__done.org> nil nil (paragraph (:standard-properties [116 116 116 200 200 0 nil nil element t nil nil nil nil #<buffer 20250103T082153--another-test__done.org> nil nil (section ...)]))] :type "denote" :type-explicit-p t :path "20250103T082129::#h:9B4FF9B7-4BA2-4B09-84F1-907A2AB35BD4" :format bracket :raw-link "denote:20250103T082129::#h:9B4FF9B7-4BA2-4B09-84F1-907A2AB35BD4" :application nil :search-option nil)) nil)
  org-open-at-point(nil)
  funcall-interactively(org-open-at-point nil)
  command-execute(org-open-at-point)

This is quite cumbersome on iOS and Android.

@amake amake changed the title [Feature proposal] Add denote link type Add denote link type Jan 2, 2025
@amake amake added the enhancement New feature or request label Jan 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants