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

A way to insert zettel-id but make it a link to the org file? #15

Closed
termitereform opened this issue Mar 29, 2019 · 5 comments
Closed

Comments

@termitereform
Copy link

termitereform commented Mar 29, 2019

I was wishing that there were a way to add links with zettel ids into my notes, and spent some time thinking about it. This is what I came up with, which does the job for me? It doesn't use Deft or Zetteldeft, though -- is it even possible to modify this to bring in some of the Deft stuff, like hopping out to deft, getting the id from the note I filter down to, and then coming back?

(defun org-insert-zettel (file-name)
  "Finds a file, inserts it as a link with the base file name as the link name, and adds the zettel-id to the front."
  (interactive (list (read-file-name "File: ")))
  (org-insert-link file-name file-name (concat "§" (file-name-base file-name))))
@EFLS
Copy link
Owner

EFLS commented Mar 30, 2019

Great that it works for you!

One issue with this, is that when you change the title of the note, the link will be broken. That's why the zettel system favours IDs rather than file links. To follow these types of "links", use zd-avy-file-search, which should be as convenient as following a link (unless you want to be able to click with the mouse).

@termitereform
Copy link
Author

termitereform commented Mar 30, 2019

You're right about the link breakage -- I guess that's what I meant by bringing this little piece of code here. Theoretically the ID should be both unique and static, so it seems possible to write some sort of link-checker function that would grab the ID of each link in the zettel, check it against the IDs in the .deft folder, and update the text between the ID and the extension in the link to address name changes to automate that maintenance. But I super don't know how to do that, haha.

And absolutely -- that id-based jump system is one of the things I really like about Zetteldeft. You've made an excellent package!

My problems are actually more with Deft than with this package, and this is me trying to work around having to use that interface for a workflow that's becoming more and more important for me.

I find Deft to be excruciatingly slow, and moreso all the time as I add entries to the Zettelkasten -- and that situation definitely doesn't seem to have any hope of getting better. I don't have the skills to find a better back-end solution, and the package seems to be in maintenance mode rather than active development so I don't think the owner is going to make big changes at this point.

I've been trying to find a way to leverage the wiki-ish link handling aspects of Org, and the ID-handling aspects of your package, to get to a place where all this is functional over the long term and with an arbitrarily large set of notes -- kind of hybridizing your zettel functions with a personal wiki. I don't know.

At this point, I'm thinking I've just gotta find some other way to implement a zettelkasten entirely.

@termitereform
Copy link
Author

termitereform commented Mar 31, 2019

For whatever it's worth, I modified the original function to create relative links rather than absolute links:

;; Insert Zettel Link
(defun org-insert-zettel (file-name)
  "Finds a file, inserts it as a link with the base file name as the link name, and adds the zd-link-indicator I use to the front."
  (interactive (list (read-file-name "File: ")))
    (org-insert-link nil (concat "file:" (file-name-base file-name) "." (file-name-extension file-name)) (concat zd-link-indicator (file-name-base file-name))))

@EFLS
Copy link
Owner

EFLS commented Mar 14, 2020

Thanks for sharing how you use the package, but I'll close this issue. Feel free to comment if you think it should be reopened.

@EFLS EFLS closed this as completed Mar 14, 2020
@EFLS
Copy link
Owner

EFLS commented Mar 25, 2020

For those who are looking for a way to integrate with org-mode links, I came up with the following: https://gist.github.com/EFLS/b64e2914fc9c51164131265a375a994a

This relies only on zetteldeft ID, not the full filename, so that it doesn't break links when files change name or are moved around.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants