sunaku / dasht

💁 Search API docs offline, in terminal or browser
https://sunaku.github.io/dasht/man
823 stars 26 forks source link

Third-party docs #4

Open eidge opened 8 years ago

eidge commented 8 years ago

Is there a way to use dasht to download kapeli's third party docs? Such as Hexdocs.pm?

I'm trying but with no success.

(Congrats anyway though, this is an excellent little app :) )

sunaku commented 8 years ago

At present, the dasht-docsets-install(1) script can only download docsets that Dash for OS X has kindly made available to us on its "Docset Direct Download Links" page. :santa: I don't know if (or where) third-party docsets are made available to us in a similar fashion, but please do tell me if you happen to find out. :crystal_ball:

:neckbeard: However, if you somehow have access to the *.tar.gz files or the *.docset folders of third-party docsets—for example, if you generated your own custom docset—then simply place them into your $DASHT_DOCSETS_DIR folder (and extract if necessary) to make them visible to and searchable in dasht.

sunaku commented 8 years ago

I've added a new dasht-docsets-extract script in commit b73f37ce0838ecaec2ee826bca113074d372fcae that further simplifies the task of installing third-party docsets directly from their *.tgz files (if you already have them in your possession).

sunaku commented 8 years ago

The dasht-docsets-extract script has been released in version 1.2.0. :gift:

emilford commented 8 years ago

@eidge Were you able to get a setup you're happy with for importing and viewing Hexdocs in dasht? I'm just starting down that path and came across this issue. Thanks.

eidge commented 8 years ago

Hi there,

Unfortunately I didn't, but to be honest I didn't take a big look. I use Linux virtual boxes for development purposes which make it very frustrating to use dash to download the docsets and then move them over to the vms. So I'm just using dash at the moment.

This would definitely unlock it though.

Thanks for the good work!

On Thursday, 1 September 2016, Eric Milford notifications@github.com wrote:

@eidge https://github.com/eidge Were you able to get a setup you're happy with for importing and viewing Hexdocs in dasht? I'm just starting down that path and came across this issue. Thanks.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/sunaku/dasht/issues/4#issuecomment-244126901, or mute the thread https://github.com/notifications/unsubscribe-auth/ACPZiPkH787rs60XepK7xgbKgyYNPstNks5qlvbPgaJpZM4HqXJB .

Hugo Ribeira

Jack of All Trades at intoCros http://intocross.coms http://intocross.com Tel: +351 910982209 http://910982209 * LinkedIn http://pt.linkedin.com/pub/hugo-ribeira/45/295/536/ * GitHub https://github.com/eidge Universidade de Coimbra

emilford commented 8 years ago

Thanks.

Downloading and extracting the docsets directly from hex.pm didn't work because of the directory structure format, sqlite, etc. required by dash. I've found that downloading the docsets via Dash and copying them to the dasht location works, as mentioned above.

sunaku commented 8 years ago

Could you provide an example URL of a hexdocs.pm docset package (tarball) so I can download it and debug why dasht-docsets-extract isn't sufficient to make it searchable with dasht?

All I could gather from hexdocs.pm's homepage was that I could access a particular hex package's documentation online via a URL like this: http://hexdocs.pm/<package>/<version>. I tried appending .tgz and .tar.gz to the URL but that did not yield a downloadable docset.

emilford commented 8 years ago

Here's an example https://repo.hex.pm/docs/ecto-2.0.4.tar.gz

There's a good chance I borked something when using dasht-docsets-extract. 😁

sunaku commented 8 years ago

:+1: This tarball simply contains a bunch of HTML files at the root: there is no SQLite3 database at /Contents/Resources/docSet.dsidx available for searching, so this isn't a proper Dash docset.

We need to transform this tarball, somehow, into a proper Dash docset to make it installable with dasht-docset-extract and searchable with dasht. Right now, I don't know how to do this. :confused:

emilford commented 8 years ago

I haven't had a chance to look at it or to give it a shot, but came across this which might help.

sunaku commented 8 years ago

:+1: Considering the fact that hexdocset has runtime dependencies on Elixir and Erlang , it seems unlikely that Dash would come bundled with it to dynamically transform hexdocs.pm tarballs into proper Dash docsets during installation on the client side. :meat_on_bone:

Instead, I believe that hexdocset is run internally by hexdocs.pm and the result is provided as a proper Dash docset to be downloaded directly into Dash for OS X. That way, Dash users are spared from having to satisfy special runtime dependencies just to install exotic docsets. :cold_sweat:

An easy way to confirm this suspicion would be to run a network traffic analyzer while downloading a brand new hexdocs.pm docset into Dash for OS X. Find out what URL is actually being downloaded: it's likely not the same one that you provided in comment https://github.com/sunaku/dasht/issues/4#issuecomment-244465110. :eyes:

Finally, repeat the experiment with other sources third of party docsets and share the results here. Of course, I could do all of this myself, except for the fact that I don't use Mac OS X at all. :penguin: :neckbeard:

emilford commented 8 years ago

There's seemingly something to do with hexdocset when downloading a hex docset within Dash. It's from a different app; the one you linked to I'd need to spend more time with to understand what I'm looking at. These results are consistent when downloading.

screen shot 2016-09-04 at 9 22 41 pm screen shot 2016-09-04 at 9 22 49 pm
sunaku commented 8 years ago

Interesting, so Dash comes bundled with hexdocset? and it uses hexdocset to build an SQLite3 database out of the HTML files on the client side? :astonished:

sunaku commented 7 years ago

Help Wanted: If anyone wants to try adding support for installing improper docsets (which don't contain a SQLite3 database at /Contents/Resources/docSet.dsidx within them, as defined in https://github.com/sunaku/dasht/issues/4#issuecomment-244471949) such as those from hexdocset, please submit a pull request and I would be glad to review and merge it! :sweat_smile:

SultanEid commented 4 years ago

I am having an issue with getting the docsets from sub-folders. I have set the directory to this:

export DASHT_DOCSETS_DIR="/Users/XXXXX/Library/Application Support/Dash/DocSets"

However, dasht does not detect .docsets files in subfolder. When i search for 'Dart' I get no result at all. after resetting the directory exactly where the .docsets files are, it seems to be working. like the following:

export DASHT_DOCSETS_DIR="/Users/XXXXX/Library/Application Support/Dash/DocSets/Dart"

but this will only get the dart docs obviously and it is very inconvenient to move all .docsets files directly in the same folder directly.

Any idea on how to properly set the DASHT_DOCSETS_DIR to look into subfolders ?

Regards, Sultan

sunaku commented 4 years ago

@SultanEid, see issue #15 instead: :tipping_hand_man: the request for adding support for subfolders is discussed there.