zeal icon indicating copy to clipboard operation
zeal copied to clipboard

Docset Groups

Open mazen-mardini opened this issue 11 years ago • 45 comments

Hello,

Could you make it possible to execute docset specific search queries. Currently, if you search for a keyword, it'll search for it in all docsets whether it's in Drupal, C++, or jQuery.

This problem can be solved in at least two ways:

Search Tags: ~~You could ether write the docset name in the beginning of the query, like this:~~ ~~"c++ std::shared_ptr"~~ EDIT: Already implemented. ~~Usage: "c++: std". "c++: std::shared_ptr" is not possible because of ambiguity in the syntax, there are several colons.~~

Or, even safer: Drag docset to the search field to add the tags. (In this case tags are not part of the text.)

Docset Groups: You could also make it possible for people to create groups of docsets depending on ones current preferences. For instance:

"Web Development" - PHP, jQuery, Drupal "Application Development" - C++, Qt5, Boost "Mobile Development" - Android

And of course the ability to easily switch between these groups from a select-list (there is a lot of space in the top-right corner btw) or from the menu bar.

Those are just my ideas, that are mostly stolen from Dash. :)

mazen-mardini avatar Dec 21 '13 02:12 mazen-mardini

As per http://zealdocs.org/usage.html, you can use "docsetname:query" to filter search by docsetname.

I agree docset groups could be also useful though.

jmymay avatar Dec 24 '13 21:12 jmymay

I was assuming that feature didn't exist at all. Sorry for that one. :D

Docset groups would be very helpful. and much easier to deal with than text based tags.

EDIT: The syntax "[docset]:[keyword]" is ambiguous. Because the keyword can include colons. For example: "c++: std::unique_ptr"

This will make zeal ignore "unique_ptr" and only search for "std" in the c++ docset. A possible solution is to make zeal ignore all colons except the first one.

EDIT 2: "C++: std::unique_ptr" is not the same as "c++: std::unique_ptr". The docset name should be case-insensitive.

mazen-mardini avatar Dec 26 '13 09:12 mazen-mardini

This will work now: "c++:std::sort"

However, these two will still not work: "c++: std::sort" - Will only search for std. "std::sort" - Will return nothing. "C++:std::sort" - Docset-tags are still case-sensitive.

How to fix ambiguities with colons:

  • Ignore all colons except for the first one.
  • If the docset doesn't exist then let the first colon be ignored too (make everything like normal text).

mazen-mardini avatar Jan 18 '14 23:01 mazen-mardini

I've tested both "c++: std::sort" and "std::sort" and it worked for me. Have you compiled the latest version?

Case-insensitive search is a good idea and is trivial to implement. Actually, as I can see from the source, the original intention was to use case-insensitive matching. I think I'll submit a patch for this problem today.

The idea with docset existence check seems good but I don't like it:

  • Query parser result becomes dependent on the global state of the system which is not good (much harder to test and predict).
  • Results could be not as expected when searching inside the bindings. I will not be able to search inside the boost::python using python::class_ query (it doesn't work now either way but because of low boost docset quality). So, I'll stick to my current hack: don't use double semicolon as a docset filter separator. Probably, we should ask @jkozera about this, since I'm just an interested contributor, not a project owner.

Docset Groups is a good thing. As I can see from demo, Dash provides automatic profile switching based on your current activity (opened applications, etc.). It's amazing stuff and it's hard to reproduce it in a portable way (from my point of view). It's much easier to implement "virtual" docsets working as a logical grouping of other docsets and allow user to create and edit them. Such a feature requires major code refactoring and I'm actually working on it now :)

roman-kashitsyn avatar Jan 19 '14 09:01 roman-kashitsyn

I can confirm "c++: std::sort", "std::sort", and "C++: std::sort" return correct results now in zeal-20140120. I like the current solution which just ignores double colons. It's simple now, and ignoring all colons except the first one wouldn't fix the plain "std::sort" case.

Ignoring double colons though may not work well with jQuery docset for example, where you have items starting with ":", so "jquery::button" doesn't return anything, but I reckon we can't always guess what the user is looking for.

jmymay avatar Jan 20 '14 01:01 jmymay

@jkozera, "c++: std::sort", "std::sort", and "C++: std::sort" are working fine with me too on the 20140122 release, for some reason it didn't work before. Anyhow, regarding the potential ambiguities that can occur with different docsets, it is a good reason to implement tags that don't interfere with the search field. Such as the ones you'd find in Dash.

@roman-kashitsyn, I agree with the first point you've made. We don't need classes to function differently based on global variables, that's just unprofessional and such programming practice will surely create more problems in the future. But passing a second argument to the constructor is also not nice, so I guess that is not a proper solution after all. And I wont argue with you on your second point, ignoring double-colons will work the same way anyway.

Thanks for all the help!

mazen-mardini avatar Jan 23 '14 08:01 mazen-mardini

For what it's worth, this is how Dash handles keywords:

  1. Assume all colons are to be searched
  2. Before the actual search, check out the query and compare it to the keywords of the installed docsets. If the query starts with a keyword (including the ending colon), remove that part from the query, activate the docset with that keyword and search
  3. If nothing matches, just search with the colon included.

Kapeli avatar Jan 23 '14 12:01 Kapeli

How this work if the docset has a space in its name? Searching "NET Framework: print", or "OpenGL 4: GL_" (for example) yields nothing, yet searching "Java SE8: print" yields many results.

archshift avatar Nov 09 '15 00:11 archshift

i like the proposition of a set of docsets (even if i would already be happy with simple checkboxes. the current "c++:" filters are a bit hard to discover and they are not really practical to type (personally i would love to avoid it, if i could)

here is a proposal:

zeal-search-sets

  • by default all docsets are activated.
  • shift click on a check box cycles between selecting only that checkbox and all checkbox but the one clicked (a standard in many programs...)
  • clicking on a checkbox makes the dropdown change to "Custom set"
  • if it's a custom set, the first entry in the dropdown is "Create new set" (based on the current selection); the last set that was selected is cached and the second entry is "Update nameOfSet set".
  • if a set is active, the first entry in the dropdown is "Disable current set" (removes the set from the list; i'd prefer not to use the term delete: the user could fear that the docsets gets deleted from her computer)

i'm not sure that the current filter (c++:...) should be kept or if having checkboxes would make it unpractical.

i'm not yet 100% sure about how much time i will have in the next future, but if you like my proposal, i might try to implement it...

aoloe avatar Jun 28 '16 20:06 aoloe

+1

Yanpas avatar Aug 13 '16 19:08 Yanpas

+1

clfsoft avatar Oct 25 '16 04:10 clfsoft

+1: I have a lot of docsets downloaded to my machine as a "just in case" measure - you never know when you might need them. But, for any given project, I can go weeks needing only one or two docsets. I wish that, during this period, I could disable the rest.

r-barnes avatar Jun 18 '17 18:06 r-barnes

You can simply rename the folders xxx.docset you don't need to xxx.docset.OFF (or any other name).

El 18 de junio de 2017 20:14:05 CEST, Richard Barnes [email protected] escribió:

+1: I have a lot of docsets downloaded to my machine as a "just in case" measure - you never know when you might need them. But, for any given project, I can go weeks needing only one or two docsets. I wish that, during this period, I could disable the rest.

-- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/zealdocs/zeal/issues/77#issuecomment-309293387

-- Enviado desde dispositivo móvil.

gomio avatar Jun 18 '17 18:06 gomio

Likewise. In fact, I deleted a bunch recently, just to work around this shortcoming in Zeal and I still need this because I'm actively working on several different projects which use mostly mutually-exclusive sets of technology.

For example, some of the mixtures are:

  • Non-SPA Web: Python 2.x, Requests, FeedParser, and a ton of web technologies (Django, Bootstrap 3, etc.) but not anything like AngularJS which degrades poorly without JS enabled.
  • One of my local GUI apps: Python 3.x, Rust, and Qt5 (glued together using rust-cpython and PyQt5)
  • High-reliability CLI scripting: Pure Rust
  • Another of my local GUI apps: Python 3.x, PyQt5, Pillow, OpenCV, and NumPy, but no Rust
  • VPS/Workstation provisioning: Ansible (which uses Jinja), Vagrant, bash, and Nginx

ssokolow avatar Jun 18 '17 18:06 ssokolow

@gomio Not good enough. I tend to work on two or more projects in parallel, so I need to be able to have different sets searchable in different Zeal tabs at the same time.

ssokolow avatar Jun 18 '17 18:06 ssokolow

I could generate a little CLI script for switching docsets in and out, but this seems like the kind of thing that would be more usefully included in Zeal itself.

Also, the duplication of docsets implied by the directory renaming would make it difficult to ensure that all the documentation stays up to date.

r-barnes avatar Jun 18 '17 18:06 r-barnes

Is there a way to start up multiple zeal instances? zeal-html, zeal-ui, zeal-personal, zeal-work, etc would be really nice.

It is super tedious to have to remove, and add docsets whenever I switch contexts.

stimata-debug avatar Jul 27 '18 17:07 stimata-debug

@0e318236-1680-41a8-a989-3c9227637cdf not at the moment, see #546 for a similar request.

trollixx avatar Jul 29 '18 05:07 trollixx

9 years. Would also love this feature.

PrinceMerluza avatar Mar 15 '19 16:03 PrinceMerluza

I just tried this feature with python3:json and the search returns nothing even if Python3 docset is installed.
If I search python:json, search returns results not pertaining to Python3 docset (in my case returns also Jinja2 tojson filter).

Asharas avatar Mar 16 '19 17:03 Asharas

As you install more docsets this becomes a usability issue. I had to deal with cluttered search results until I decided to search for this issue and came across this. I understand the hack with text filters but having to type it every time undoes some of the productivity that you get from fast searches.

@aoloe have you had any luck realizing the mock-up you showed earlier?

jotaf98 avatar Apr 17 '19 12:04 jotaf98

hi @jotaf98 no, as i wrote in my reply i would only try to do it if there is a consensus (if possible an ok from the maintainers) on the proposal being a good solution.

i'm currently rather busy with other projects, and getting started on a new code base would be a bigger step for me...

aoloe avatar Apr 18 '19 08:04 aoloe

@aoloe Yes I understand, it's a lot of work to dig in an unknown codebase. Just wanted to ask, thanks!

jotaf98 avatar Apr 18 '19 14:04 jotaf98

I have to check differences for 3 lua versions (lua 5.1, lua 5.2 and lua 5.3) for what I'm developing right now and the lua: tag will include search results from all 3 versions. The group idea would also help me a lot. The idea is not far-out and already have been implemented in projects such as Qt's official documentation browser — Qt Assistant — for a long time: https://doc.qt.io/qt-5/assistant-details.html#filtering-help-contents

assistant-preferences-filters

vinipsmaker avatar Jun 24 '19 14:06 vinipsmaker

+1 this is an amazing tool, but I find having to type a label each time frustrating. Personally I'd like if the search would only ever search the currently selected docset, and that global searches never ocurred.

Perhaps this could be an option in the preferences which would avoid needing much changes to the UI otherwise?

bobbles911 avatar Jul 03 '19 00:07 bobbles911

I suggest a drop down list next to the search text field where you select the docset you want to search in. much more usable than typing docsetname: searchtext. Implement groups by creating new elements for this drop down list as composites of existing docssets. This should be an edge case anyway. To keep current feature of searching all docsets, there should be an "all" option in the drop down list.

FalcoGer avatar Apr 20 '20 19:04 FalcoGer

That depends on your definition of "usable". It's much more discoverable, but much less time-efficient for a skilled user... similar to the trade-off between a CLI and a GUI.

Instead, I'd propose a button next to the field which pops up a window similar to a browser's search keyword editor. That could do double duty as a reference for defined keywords so users don't have to trial-and-error their way to figuring out what the keyword is for something, and an editor for new ones. (Ideally, it'd also allow you to modify existing ones so I could do things like turning jQuery into jq, giving python2 and python3 disjoint keywords, etc.)

ssokolow avatar Apr 20 '20 19:04 ssokolow

Search prefixes are convenient, and I don't want to remove them. What's lacking is an easy way to discover them, and related or user defined grouping of docsets.

A lot can be done on the UI side. I think Dash just converts prefixes to check marks in the docset selection dropdown.

trollixx avatar Apr 20 '20 20:04 trollixx

The issue I have with it is that when I work on something, I usually reference the same docset over and over (read: I don't switch between them often/at all). and when I want to look up sum I don't want to write c++: or mysql: or something even longer like python3: in front of it. that's 75% of the search word specifying what docset i want to look in. And that's for everything I want to look up. I like to just click the search field, ctrl+A and type what i want to know. That's why I suggested the drop down list. It's fixed and not directly affected by what I type into the search box. The checkbox idea next to the docsets is okay, too. Or maybe both, one option affecting what the other is set to.

That depends on your definition of "usable". It's much more discoverable, but much less time-efficient for a skilled user... similar to the trade-off between a CLI and a GUI.

I don't think this is the case or fair. GUIs can be faster than CLI. (certainly so with long, clunky and just the right mixture of "too verbose and lots to type, but not explaining enough" option flags as you find them in cmake scripts, opposed simple click in a checkbox which is nicely labeled). Basically it all comes down to design. Moving your mouse once a few pixels next to the search bar and selecting your docset(s) from a drop down list before clicking into the search bar certainly is faster, especially the more you search since the former you only have to do once, and typing it out every time will add up.

It doesn't seem too complicated to do, and if I knew the slightest bit of QT5 coding, I'd fork and try it. But I do not and it's not too pressing for me and I have other things to do unfortunately.

FalcoGer avatar Apr 21 '20 00:04 FalcoGer

Moving your mouse once a few pixels next to the search bar and selecting your docset(s) from a drop down list before clicking into the search bar certainly is faster, especially the more you search since the former you only have to do once, and typing it out every time will add up.

Except that I want to switch my right hand back and forth between mouse and keyboard as little as possible in performing a query and I tend to switch back and forth between projects, so I don't want to have to keep playing around with a selector dropdown. (Though having the ability to map a custom prefix like ocr to "Python 3.x (stdlib only), Qt5, and OpenCV" for my "custom OCR frontend" project would be very nice.)

Win + Z pyTabzipi (The entry for zipfile.ZipInfo appears) Enter (Input focus shifts to the main panel) (read) Page Down (read) Page Down (read) Ctrl + Z

For anything else, I'd have to switch to the mouse to select among the results without far too many keypresses, but that's just one switch at the end.

...and, sometimes, I do this:

Win + Z Ctrl + Shift + N (Why is this not Ctrl + T like every other tabbed UI?) qTabrestoresEnter (read for a bit) Win + Z

Throw in things like / (a simpler-to-type alternative to Ctrl + F), Esc, and Page Up/Page Down and I often interact with Zeal without ever taking my hands off the keyboard.

I just wish it were more Keyboard-friendly. For example, supporting tab-completion within searches so pyTabzipiTab would produce python:zipfile.ZipInfo so I could then continue with .com without having to type out the whole zipinfo.com.

If I can ever get around to being on a current version, I want to verify that it still has the weird "gets confused about focus and requires me to rapidly tap Ctrl+Z to get it to dismiss" bug and report it. (As well as how bad a design it is for "Please wait for all operations to finish" to continue to come up after the progress indicator has gone away because, apparently, it only provides visual feedback for the download phase of updating a docset.)

ssokolow avatar Apr 21 '20 01:04 ssokolow