[Draft - RFC] docs: Adding custom docsets #133
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hello! I saw your recent change which enabled the workaround for anchors in the doc plugin. Thank you for including that. The python docs now work so much better.
I have another patch that I've added on my builds of Albert. It's not "production quality" but I rely on it a lot. Many projects I care about don't have documentation included in the Zeal documentation list. I can generate docsets, but getting Albert to recognize them is not currently implemented: you can only select from the list downloaded from the Zeal API. You can contribute them to Dash, but as far as I can tell, the user contributed docsets don't make it into the list used by Zeal so that doesn't help here.
So this patch adds a very clunky means to add a
custom_docsets.json
file which, when detected, will add any locally installed docsets into the list, which users can then enable or disable as normal. You just need to create a JSON blob that looks the same as the ones returned by the API. Obviously this isn't a good user experience, and the code is pretty yucky, since I wanted to make the minimal amount of changes necessary to make it work.Thus I wanted to ask -- how would you prefer to see something like this implemented? The best way would seem to be having a dialog box in the config section that prompts for the file/directory, a name, and the necessary icon info. It would be a learning experience, but I could try to do that. Alternatively, we could make it easier (no JSON) by automatically detecting any directory in the
~/.local/share/albert/docs/custom-docsets/
directory. The icon could be stored in a well-known filename, and the project name could be inferred from the directory name.Thanks!