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

[Draft - RFC] docs: Adding custom docsets #133

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

brenns10
Copy link

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!

This is a bit gross in order to avoid changing the existing code and
indentation, so the patch will apply for longer. But essentially, once
we've read the network/cached docset list, we then open a custom list,
read and parse that, and re-run the logic so that we can add in the
custom docsets too.

Signed-off-by: Stephen Brennan <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant