HiPhish

HiPhish

Getting documentation programmatically?

Hello,

I know that I can get the documentation of a symbol in iex by typing h whatever, but is there a way to get this documentation programmatically? For context, I use Neovim and I would like a way of reading the documentation inside an editor buffer instead of a REPL running inside a terminal shell. I have already written info.vim which does similar thing for GNU Info documents. Neovim makes it possible to write remote plugins in Elixir, so if there is some Elixir module to get the documentation as a text string it should be fairly simple to pull off.

Most Liked

axelson

axelson

Scenic Core Team

I just wanted to make sure you’re aware that there are existing ElixirLS-powered vim/neovim extension that already support fetching Elixir documentation:

But if you want to create to create this extension for learning purposes, or as an improvement (such as being lighter-weight), then please go ahead :+1:

HiPhish

HiPhish

Yes, I am aware of it and I’m using it, it’s a fantastic tool.

That’s the plan, I am working through the guide right now and I want to try my hands at something useful next. Plus, I prefer reading documentation in a separate buffer I can have open to the side rather than a floating window. I could have probably hacked something using the Lua API of the built-in client, but this seems more interesting. Plus it would work even without a language server running.

emoragaf

emoragaf

Take a look at h implementation: elixir/lib/iex/lib/iex/introspection.ex at d8d89b431e197dd230ce01bc20f4656d9ef24e5c · elixir-lang/elixir · GitHub

It seems to be using Code.fetch_docs underneath

Last Post!

lukaszsamson

lukaszsamson

ElixirLS Core Team

If you are looking for something more lightweight than a full language server than you could try elixir_sense, the lib utilised by elixirLS - elixir_sense/lib/elixir_sense.ex at 28f8467a349c6ed004aac66a2e8d7020cdde2e0d · elixir-lsp/elixir_sense · GitHub

Where Next?

Popular in Questions Top

Qqwy
Original source of discussion: This topic on the Pragmatic Programmers’ Functional Web Development with Elixir, OTP, and Phoenix forum. ...
New
New
Emily
I have VueJS GUIs with the project generated using Webpack. I have Elixir modules that will need to be used by the VueJS GUIs. I forese...
New
9mm
I am constructing a JSON object (map) and I need to conditionally set a field. I’m trying to write proper elixir-way code… and I’m at a l...
New
sergio_101
I am VERY much an elixir newbie. I have taken one elixir course and one phoenix course on Udemy. During that course, I saw the instructor...
New
shijith.k
I am trying to start a new phoenix project with elixir 1.9, but mix phx.new does not work. It says that ** (Mix) The task "phx.new" could...
New
Patoshizzle
After calling mix ecto.create I get this error: 17:00:32.162 [error] GenServer #PID<0.412.0> terminating ** (Postgrex.Error) FATAL...
New

Other popular topics Top

joaquinalcerro
Hi there, I am working with Ecto-Postgresql and I need to call all of the records from a specific table but the table has 40,000 records...
New
vonH
When I run the Plug and I recompile I wind up having to use Ctrl C to quit iex and start again. Witht the help of rlwrap I can use the cu...
New
vonH
In asking this question I am more interested about the expressiveness of the language itself and less concerned about the availability of...
New
lanycrost
Hi everyone! I need implement if…else if…else condition from my elixir code, and anymore of this control flow structures not work proper...
New
nsuchy
Hi. I’ve noticed that Windows Powershell has it’s own IEX command and you cannot access Elixir’s IEX due to the conflict. This isn’t a cr...
New
alice
Hey, Just curious what are the main benefits of Elixir compared to Clojure? When is Elixir more useful than Clojure and vice versa? Th...
New

We're in Beta

About us Mission Statement