ZettelGeist / zettelgeist

A less-is-more (distributed) notetaking application. Designed specifically for those who prefer working with the command line and want to do crazy indexing, analysis, and transformation of notes. Aimed at but not limited to scholarly research projects.
Apache License 2.0
30 stars 5 forks source link

"--show-all" option with zfind? #30

Closed avanides closed 2 years ago

avanides commented 2 years ago

It would very useful to run a zfind query and have the option to output the results as entire cards, which would in essence recreate the act of taking a physical Zettel out of an actual Zettelkasten. I am often not aware of everything that I wrote down in a given Zettel, much of which is likely of relevance for whatever it is I might be researching. Having the option to "--show-all" (or something similar) instead of listing every possible "--show" would streamline the process significantly.

icornelius commented 2 years ago

Thanks for this feature request.

Meantime you can get the results you seek with this command

cat $(zfind --database index.db --query-string 'KEY:"VALUE"' --show-filename | grep PATH | sed 's/filename: //')

Notes:

  1. Replace KEY and VALUE with your search criteria
  2. Replace PATH with any part of the path to your zetteln
  3. Optionally, pipe to less

To troubleshoot, build up from the core zfind command.

gkthiruvathukal commented 2 years ago

@avanides and @icornelius, we now have a --show-all option. You'll have to upgrade to the latest version via pip.

gkthiruvathukal commented 2 years ago

The docs will need to have a corresponding update, @icornelius. The semantics of --show-all are to show any field that is actually being used in the zettel.

icornelius commented 2 years ago

Docs are updated: https://github.com/ZettelGeist/zettelgeist/wiki/Getting-Started Thanks @gkthiruvathukal and @avanides !

avanides commented 2 years ago

@gkthiruvathukal @icornelius - thanks so much for this - works flawlessly!

gkthiruvathukal commented 2 years ago

Happy new year, @avanides!