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 ability to search for #tag #3

Open
marbetschar opened this issue Jan 31, 2023 · 2 comments
Open

Add ability to search for #tag #3

marbetschar opened this issue Jan 31, 2023 · 2 comments

Comments

@marbetschar
Copy link

marbetschar commented Jan 31, 2023

Hi Christian 👋 ,

Thank you very much for NoteExplorer - it has proven to be a handy little tool! While tinkering with it a bit more I was wondering whether it would be feasible to add the possibility to add a search for #tag to NoteExplorer?

Apart from linking notes to each other, I also add tags to them (e.g. #my-tag). It would be wonderful to be able to filter Zettel by a given tag with something like this:

noteexplorer list-with-tag #my-tag      Prints a list of notes with the tag #my-tag

Some more info about my use case: I'm playing with the idea of publishing a subset of my notes to a website and would love to retrieve all notes with the tag #public for this purpose. I will then create a GitHub action to automate the publishing (basically a simple copy & paste of the note).

UPDATE: Alternatively retrieving tags from YAML Frontmatter would be fine for me as well - or supporting even both approaches 🤷

---
tags: [my-tag, another-tag]
---
@cdaven
Copy link
Owner

cdaven commented Feb 3, 2023

I'm currently neither using nor developing NoteExplorer myself, but I may have a look at the code and try something out.

@cdaven
Copy link
Owner

cdaven commented Apr 10, 2023

As a "workaround", I would suggest using ripgrep to search for "#tag" like so:

rg --type md --ignore-case --fixed-strings "#tag"

Ripgrep does full-text search in all files in all subdirectories, using regular expressions by default, so it should be a good match for this use case.

  • --type md only searches Markdown files
  • --ignore-case matches "#TAG" as well
  • --fixed-strings assumes "#tag" is a normal string and not a regular expression

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