You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+21-18Lines changed: 21 additions & 18 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -28,11 +28,13 @@ ExDoc ships with many features:
28
28
* Show tooltips when mousing over a link to a module/function (works for the current project and across projects)
29
29
* A version dropdown to quickly switch to other versions (automatically configured when hosted on HexDocs)
30
30
31
-
## Using ExDoc with Mix
31
+
## Usage
32
32
33
-
To use ExDoc in your Mix projects, first add ExDoc as a dependency.
33
+
You can use ExDoc with Mix (recommended for Elixir projects), with Rebar (recommended for Erlang projects), or via the command line.
34
34
35
-
If you are using Elixir v1.10, or later:
35
+
### Using ExDoc with Mix
36
+
37
+
First add ExDoc as a dependency. ExDoc requires Elixir v1.10 or later:
36
38
37
39
```elixir
38
40
defdepsdo
@@ -42,11 +44,7 @@ def deps do
42
44
end
43
45
```
44
46
45
-
> #### Note {: .info}
46
-
>
47
-
> If you are using Elixir v1.7, v1.8, or v1.9, use `~> 0.22.0`.
48
-
49
-
After adding ExDoc as a dependency, run `mix deps.get` to install it.
47
+
Then run `mix deps.get` to install it.
50
48
51
49
> #### Erlang development environment {: .warning}
52
50
>
@@ -76,7 +74,11 @@ end
76
74
77
75
Now you are ready to generate your project documentation with `mix docs`. To see all options available when generating docs, run `mix help docs`.
78
76
79
-
## Using ExDoc via command line
77
+
### Using ExDoc with Rebar3
78
+
79
+
From Erlang/OTP 24+, you can use ExDoc to render your Erlang documentation written with EDoc. See [`rebar3_ex_doc`](https://github.com/starbelly/rebar3_ex_doc/) for more information.
80
+
81
+
### Using ExDoc via command line
80
82
81
83
You can ExDoc via the command line as follows:
82
84
@@ -107,9 +109,15 @@ For example, here are some acceptable values:
107
109
GITHUB_USER => elixir-lang
108
110
GITHUB_REPO => ecto
109
111
110
-
## Using ExDoc with Erlang projects
112
+
## Syntax highlighting
111
113
112
-
From Erlang/OTP 24+, you can use ExDoc to render your Erlang documentation written with EDoc. See [`rebar3_ex_doc`](https://github.com/starbelly/rebar3_ex_doc/) for more information.
114
+
ExDoc uses [the makeup project](https://github.com/elixir-makeup/makeup) for syntax highlighting. By default, it includes highlighters for Erlang and Elixir. To highlight other languages, simply add the equivalent `makeup_LANGUAGE` package to your `mix.exs`/`rebar.config`. For example, for HTML support, you could add:
You can also use a custom text, e.g.: `` [custom text](`MyModule.function/1`) ``. This also allows to refer to OTP modules, e.g.: `` [`:array`](`:array`) ``.
150
158
151
-
Link to extra pages like this: `` [Up and running](Up and running.md) `` (skipping the directory
152
-
the page is in), the final link will be automatically converted to `up-and-running.html`.
159
+
Link to extra pages like this: `` [Up and running](Up and running.md) `` (skipping the directory the page is in), the final link will be automatically converted to `up-and-running.html`.
153
160
154
161
## Admonition blocks
155
162
156
-
You may want to draw attention to certain statements by taking them out of the
157
-
content's flow and labeling them with a priority. These are called admonitions,
158
-
sometimes are also known as asides or callouts. An admonition block is rendered
159
-
based on the assigned label or class. `ex_doc` supports the following tags:
160
-
`warning`, `error`, `info`, `tip`, and `neutral` over header levels `h3` and `h4`.
163
+
You may want to draw attention to certain statements by taking them out of the content's flow and labeling them with a priority. These are called admonitions, sometimes are also known as asides or callouts. An admonition block is rendered based on the assigned label or class. `ex_doc` supports the following tags: `warning`, `error`, `info`, `tip`, and `neutral` over header levels `h3` and `h4`.
0 commit comments