Skip to content

Conversation

@brenns10
Copy link
Contributor

@brenns10 brenns10 commented Sep 4, 2025

Hello! This has two changes, which I can split up if you want to review them separately. First is a fix for #1, taking your approach of extracting the docset into the docset directory. Thankfully QTemporaryDirectory allows specifying a custom temporary pattern, so we can specify where we want the temporary directory, while still getting the rest of the semantics (auto deletion) for free.

The second change is a much nicer way of approaching albertlauncher/plugins#133: "custom docsets". I'd like to be able to browse docsets that aren't part of the Zeal collection. So I add a second directory where you can place any directory named *.docset which contains an icon. Albert detects these and includes them in the collection of docsets.

The use of QFile::move() to move the docset into its final location only
works if the temporary directory and the docset directory are on the
same filesystem. Rather than recursively copying the docset directory,
just use a temporary directory within the docset directory. This should
make it nearly certain that they reside on the same filesystem.
Zeal has an extensive library of docsets, but it's possible to manually
create docsets too. Allow the user to place docsets into a separate
directory (~/.local/share/albert/docs/custom_docsets) with an
appropriate icon file. Search this directory for valid docsets and index
them just like the ones downloaded from Zeal.
@ManuelSchneid3r
Copy link
Member

@ty brenns. merged manually to make conventional commit messages. im curious though which kind of custom docsets do you use? is there some other source of docsets out there?

@brenns10
Copy link
Contributor Author

@ManuelSchneid3r thank you! I like to have docsets for some python libraries that I use in my daily work, like drgn. There is a project called doc2dash which allows you to convert the sphinx documentation for a Python library into a docset.

I don't know if the dash project wants to have very specific libraries like that, and I don't know that it would be worth maintaining officially. So that's why I like being able to build a docset locally and put it into my Albert directory.

@ManuelSchneid3r
Copy link
Member

This sound actually pretty useful. If you have some spare time, you could put a little tutorial into the readme. Or just post it here and I'll add it

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.

2 participants