How reasonable is this proposal?
The h command uses two underlying library calls to get data.
Code.get_docs(module, :moduledoc) -> { line_number, markdown_moduledoc }
Code.get_docs(mod, :docs) -> list of function doc tuples. [1]
What if we put those two signatures into a Behaviour called "ExternalDocs" and
allowed a configuration setup in .iex to point to a Module that implemented these
behaviours?
The simplest thing possible would simply to return a URL to the Erlang doc site for
everything.
I can imagine a module that opens that URL for people or finds the corresponding
html on the local disk. Or one that parse man pages into markdown...
The part that probably can't be easily solved is Erlang modules that are not part of
the standard library. But there is so much in the Erlang standard library that even
exposing just that would be of benefit.
- Booker C. Bense
[1]- You can "fake" most of Code.get_docs using module.module_info(:exports)
you have to lie a bit about the line numbers and signatures, but those aren't used
by the h command anyway.