IExHelpOpen - opens documentation in a browser window

, ,

Hey everyone,

As you might know, Hex recently got a new option to open up documentation for a particular module in a browser window, e.g.: mix hex.docs open ecto --module Ecto.Changeset which I find very useful.

I thought it would be cool to have similar ability inside an iex session so I built: GitHub - wojtekmach/iex_help_open.

Here’s a quick demo how this works:

It’s in a very early version and supports just functions, but if there’s interest in it I’d be happy to extend it to support more features. (It would likely require a rewrite from scratch :smile:.) Any feedback and/or contributions are very welcome in the meantime!

13 Likes

Ah, goodness, this is great! These are the types of tools we really need. I had in mind to make a remote version of this at some point, because I wanted to use it across VM/machine boundaries, so I could spawn new tabs of docs on other machines or outside my VM. I might actually take a look at this to extend it into that. Thanks for rekindling this. :slight_smile:

1 Like

With Ehelper I got as far as printing out the url’s for everything you can access via the h command, the standard Erlang libraries, and anything you have installed via hex.

https://github.com/philosophers-stone/ehelper/blob/master/lib/doc_help/print_url.ex

I just looked at the openurl helper and it needs some TLC. I’m thinking some code got lost along the way since
it opens dash url’s.

nice! I’ve only learned about ehelper some hours after publishing the package above :sweat_smile:

I just looked at the openurl helper and it needs some TLC

the code I’m using for that is taken from hex and it seems to work pretty well: hex/lib/mix/tasks/hex/docs.ex at v0.15.0 · hexpm/hex · GitHub so I suppose it could be that if the user has dash installed then it uses that, otherwise opens it up in the browser.