Start IEx with your project loaded so all dependencies are available:
cd ~/projects/speechwave-live/speechwave
iex -S mix
Then use the h helper:
h Enum.map # docs for a specific function
h Enum.map/2 # docs for a specific arity
h Phoenix.LiveView # module-level docs
h Phoenix.Component.assign # fully qualified name: check the source module
Other useful IEx helpers:
| Helper | Does |
|---|---|
h Module | Module docs (@moduledoc) |
h Module.func | Function docs (@doc) |
t Module | List types defined by the module |
b Module | List callbacks (for behaviours like GenServer) |
i value | Info about a value (type, module, etc.) |
exports Module | List all public functions and their arities |
Tab completion works in IEx. Type Enum. and press Tab to see all functions.
# Download docs for a dependency
mix hex.docs fetch phoenix_live_view
# Open in browser (with search)
mix hex.docs offline phoenix_live_view
# Other common packages
mix hex.docs offline phoenix
mix hex.docs offline ecto
mix hex.docs offline ecto_sql
# Switch a package back to online docs
mix hex.docs online phoenix_live_view
Fetched docs are cached locally, so you only download once per version.
| Package | URL |
|---|---|
| Elixir standard library | hexdocs.pm/elixir |
| Phoenix | hexdocs.pm/phoenix |
| Phoenix LiveView | hexdocs.pm/phoenix_live_view |
| Ecto | hexdocs.pm/ecto |
| Any hex package | hexdocs.pm/<package_name> |