Packages
Creates documentation for Elixir projects in JSON format
Current section
Files
Jump to
Current section
Files
ex_doc_json
README.md
README.md
# ExDocJson
The `ExDoc.Formatter.JSON` formatter extends [ExDoc][] to generate JSON
documentation for Elixir projects.
## Installation
The package can be installed by adding `ex_doc_json` to your list of
dependencies in `mix.exs`:
```elixir
def deps do
[
{:ex_doc_json, "~> 0.3.0", only: :dev, runtime: false}
]
end
```
It requires ExDoc v0.40.1 or later. `ex_doc_json` v0.2 works with ExDoc
v0.30.0 to v0.30.7 only; there is no release for the ExDoc versions in
between.
## Usage
Run `mix docs --formatter json`, or add the formatter to your documentation
configuration in `mix.exs` to have it run along the default ones on `mix docs`:
```elixir
def project do
[
app: :my_app,
version: "0.1.0-dev",
deps: deps(),
# Docs
docs: [
formatters: ["html", "epub", "json"]
]
]
end
```
The documentation is written to a single file in the output directory, named
after the project: `doc/my_app.json` in the example above. See
`ExDoc.Formatter.JSON` for a description of its contents.
Further documentation can be found at <https://hexdocs.pm/ex_doc_json>.
[ExDoc]: https://github.com/elixir-lang/ex_doc