Well as a macOS user, there’s an application which is very good for this and has a plugin with numerous IDE/Text editor: Dash.
Once you’ve downloaded the language doc, for some languages you got access to “docsets”, that’s the case for Elixir/Erlang.
It’s not terminal based, but once downloaded it’s ok to use offline, plus it updates automatically.
IDK if it’s okay to promote something like this here but, since it’s a tool, a cheap one furthermore, I guess there’s no problem.