Closed erictleung closed 4 years ago
Ooh that's nice. I'm working on a sort of Zetteldeft knowledge base (in Zetteldeft of course) and will make sure to include this piece of code.
I think it is nice to provide these as snippets that people can use as they see fit, rather than features included in the code itself, as I don't think it is core functionality. At least for now.
A knowledge base sounds like a great idea. I look forward to reading it. And thanks for your consideration. Plug-and-play snippets sounds really nice actually.
I've changed your code a bit, so that it
deft
knows about (since directory-files
will also return .
and ..
, and won't respect deft-recursive
, deft-ignore-files-regex
etc.)I've called it zetteldeft-wander
. Really nice idea! Maybe I should consider including it in the main code after all...
(defun zetteldeft-wander ()
"Wander through `zetteldeft' notes.
Search `deft' for a random `zetteldeft' id."
(interactive)
(switch-to-buffer deft-buffer)
(let ((all-files (deft-find-all-files-no-prefix)))
(deft-filter
(zetteldeft--lift-id
(nth (random (length all-files))
all-files)))))
This is now included in https://github.com/EFLS/zd-tutorial, which serves as both a knowledge base and a tutorial. More discussion in #64.
Feel free to leave a comment if you think this should be part of the core feature set.
In using
org-brain
, I really liked its wander feature, which brings a note randomly. It essentially randomly samples the notes created and displays it. This can be helpful as an informal 'quiz' of your knowledge base or at least refresh your memory that the particular note exists. From there you can edit it with current knowledge or link it to other notes.I'd like to propose a similar function in
zetteldeft
.I've created a simple function to accomplish this.
I'd run this after being in the deft buffer. So after running
deft
(C-c d d
), I'd run the aboveetl/zetteldeft-ergodic
which will randomly retrieve a random note ID and search for it.Thanks for creating this package.