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 neuron query --list-tags #110

Closed
srid opened this issue Apr 16, 2020 · 6 comments
Closed

Add neuron query --list-tags #110

srid opened this issue Apr 16, 2020 · 6 comments
Labels
enhancement New feature or request

Comments

@srid
Copy link
Owner

srid commented Apr 16, 2020

A way to retrieve the list of all tags used in a Zettelkasten.

CLI spec: (--list-tags | --tag TAG | --uri)

@srid srid added enhancement New feature or request good first issue Good for newcomers labels Apr 16, 2020
@srid
Copy link
Owner Author

srid commented Apr 16, 2020

As well as perhaps --uri zquery://tags (so that we can have a zettel show a list of links to tags as well).

@felko
Copy link
Contributor

felko commented Apr 18, 2020

Since #115, a --tag-tree command might be helpful to allow editors plugins to implement some kind of "tag browsing" feature.

@srid
Copy link
Owner Author

srid commented Apr 18, 2020

Agreed. What would be the zquery URI equivalent? Here's what I think, at the moment:

  • zquery://tags -- show a list of tags in the UI, linking to search.html?tag=foo
  • zquery://tags?tree -- same, but render as a tree
    • Or, alternatively, zquery://tags?root=/ -- same as before
    • Whereas zquery://tags?root=math would render only the math sub-tree

Then have CLI map to those queries.

@felko
Copy link
Contributor

felko commented Apr 18, 2020

Do all the queries need to have a corresponding URI? I would prefer zquery://tags to display the tree in all cases, as it is easier to browse.

I like the zquery://tags?root=math. I would also allow globbing like zquery://tags?glob=math/* since it could happen that you want to display the tree only one level deep.

What would the output look like in the HTML? Will the matched tags be displayed in a tree without any zettels inside? If so, then some kind of zquery://outline?root=math might be useful as well. Here is an idea of how that would look like, assuming that the only tags under math are math/algebra and math/calculus:

# math
[.](zquery://search?tag=math)

## algebra
[.](zquery://search?tag=math/algebra)

## calculus
[.](zquery://search?tag=math/calculus)

That allows the creation of "dynamic outlines" which are automatically updated as new zettels are created under the math tag. Anyway, that should be discussed in a separate issue.

@srid
Copy link
Owner Author

srid commented Apr 18, 2020

It is good to have a 1-on-1 map to queries. I think of neuron query --whatever simply as an alias for using the full form neuron query --uri. Plus, it forces us to think how whatever querying we add to the CLI would impact the HTML view.

Alright, let's do tree by default, and go with zquery://tags?filter=math and zquery://tags?filter=math/* ("filter" is more appropriate naming here, and consistent with the tag-based filtering of search?tag=...).

What would the output look like in the HTML?

Tree of links to the tag search page.

Will the matched tags be displayed in a tree without any zettels inside?

Why would we show the zettels? The user is querying for tags only, not the zettels.

Your outline proposal should indeed be discussed in a different issue (and since you are querying for zettels effectively, it should be done in the zettel query search, but perhaps with a groupBy option i.e.: zquery://search?tag=math/**&groupBy=tag).

@felko felko mentioned this issue Apr 20, 2020
@srid srid removed the good first issue Good for newcomers label Apr 22, 2020
@srid
Copy link
Owner Author

srid commented Apr 27, 2020

neuron query --uri zquery://tags returns all tags (as tree), but if somebody really wants a list format, open a PR.

@srid srid closed this as completed Apr 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants