Local access to elm documentation?

hello people,

I would like to get a local/cached version of the documentation (ideally in a pure text or troff format). i really don’t know the elm ecosystem at all but i imagine there is no such thing available.

if there isn’t, is there a way to query https://package.elm-lang.org/ with a rest API to know what is the URL of the page i need to download locally.

for example: from the key “String”, i would like to access to https://package.elm-lang.org/packages/elm/core/latest/String but i haven’t found a rest API to do so.

any help to do so (or link to existing tool) would be very welcome!

thanks
marc

2 Likes

Hi @eiro, all packages that you’ve already installed live somewhere in ~/.elm and thanks to this, tools like dmy/elm-doc-preview are able to retrieve their documentation for local usage.

Once installed, you can try the command elm-doc-preview from anywhere and it should open a web page served by a localhost server with the documentation. I also like the --port and --no-browser options.

In addition, if you run elm-doc-preview from an elm project of yours, it will provide the documentation for that project.

6 Likes

hello Matthieu,

dmy/elm-doc-preview are
able to retrieve their documentation for local usage.

even if it’s not what i expected in term of ui, this is a real
improvement to me.

thanks!
marc

Or you can use Dash or Zeal and download Elm docset. I’m trying to keep it updated on the newest version on monthly basis.

If you would like to dig deeper, you can take a look at the python script I’m using to generate the docset and bend it to your needs :wink:

1 Like

Where can I download the Elm docset for Zeal?

I don’t use Zeal, so I can’t tell you that for sure - but you should be able to do it like this:

You can do this using Edit > Options > Docsets > Download.

It is a User Contributed docset, so maybe it will be somewhere deeper than on the main page, hard to tell. Let me know if you have found it and how, please.

There is only one place in Zeal for downloading docsets and Elm is not listed there. “User Contributed” docsets is not mentioned anywhere.

OK, this should help:

So the address you are looking for is probably this one:

http://newyork.kapeli.com/feeds/zzz/user_contributed/build/Elm/Elm.tgz

Or even better, I have found this app with the link to the XML feed:

1 Like

The “Feed URL (.xml)” there worked:

EDIT: The URL must be “Feed URL (.xml)” and not “Feed URL”. Both will add the docset, but without .xml in URL it will be saved as .docset instead of Elm.docset.

1 Like

Cool, enjoy your offline docs then :wink:

i just had to seat there and read the thread! still not in my terminal
but zeal is much closer than what i expected and there are other docs i
can download that way.

thanks to both of you.
regards
marc

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.