xwmx / nb

CLI and local web plain text note‑taking, bookmarking, and archiving with linking, tagging, filtering, search, Git versioning & syncing, Pandoc conversion, + more, in a single portable script.
https://xwmx.github.io/nb
GNU Affero General Public License v3.0
6.43k stars 181 forks source link

[Question] Is there a way to replace or create tags in a created document (note, bookmark, todo) #214

Open nitaicharan opened 1 year ago

nitaicharan commented 1 year ago

Thank you for this useful tool.

I'm trying to add tags to created documents without having to edit them. Is that a command line way to do it so?

xwmx commented 1 year ago

Hi @nitaicharan! Not currently. That sounds like a useful feature to add to edit.

nitaicharan commented 1 year ago

Thank you for your reply @xwmx. Yes, it's very useful in case you have many imported notes. I came from notion and I imported more than 300 notes. Imagine how much time I will expend to tag all of them. I guess it's not only me but many people who switch between notes software they will find a way to import in the easier way their notes.

Another feature that I looked for when I found nb was: In the case of nb, there is no way (as far as I know) to save a filter to just select after this filter and see all notes from it creating then a view like on Notion. Ex: I could save notes with react, angular, or whatever tag and after just look for it. It will allow even make more complex filters to look for multiple filter values at the same time. Ex: filter for all angular and course tags, then I would find all notes (class notes) of angular of all courses. Or even set a third tag to filter by some specific angular class course. To make this explanation short, I know there is a way to search by multiple filters but it would be a good idea to have a way to save a pre-select search. It will allow the creation of visions or views of pre-selected filters.

xwmx commented 1 year ago

@nitaicharan, nb now (version 7.1.0+) supports searching tags similar to how you described. Quoting the README:

List tagged items by passing \#escaped or "#quoted" hashtags or tags specified with the --tags option to nb / nb ls:

# list items in the current notebook tagged with #tag1, escaped
nb \#tag1

# list items in the "example" notebook tagged with #tag2, quoted
nb example: "#tag2"

# list items in all notebooks tagged with #tag3, long option
nb --tags tag3 --all

# list items in all notebooks tagged with #tag3, short option
nb --tags tag3 -a

Combine multiple tags to search for items containing all specified tags:

# list items in the current notebook tagged with #tag1 AND #tag2
nb \#tag1 "#tag2"

# list items in the current notebook tagged with #tag2 AND #tag3
nb --tags tag2,tag3

# list items in all notebooks tagged with #tag1 AND #tag2 AND #tag3 AND #tag4
nb \#tag1 "#tag2" --tags tag3,tag4 --all
nitaicharan commented 1 year ago

@nitaicharan, nb now (version 7.1.0+) supports searching tags similar to how you described. Quoting the README:

List tagged items by passing \#escaped or "#quoted" hashtags or tags specified with the --tags option to nb / nb ls:

# list items in the current notebook tagged with #tag1, escaped
nb \#tag1

# list items in the "example" notebook tagged with #tag2, quoted
nb example: "#tag2"

# list items in all notebooks tagged with #tag3, long option
nb --tags tag3 --all

# list items in all notebooks tagged with #tag3, short option
nb --tags tag3 -a

Combine multiple tags to search for items containing all specified tags:

# list items in the current notebook tagged with #tag1 AND #tag2
nb \#tag1 "#tag2"

# list items in the current notebook tagged with #tag2 AND #tag3
nb --tags tag2,tag3

# list items in all notebooks tagged with #tag1 AND #tag2 AND #tag3 AND #tag4
nb \#tag1 "#tag2" --tags tag3,tag4 --all

Thank you for your reply. Please consider the feature to replace tags in a set of notes automatically through a command line option. And the possibility of saving pre-searched tags and we would be able to create views like in Notion