Skip to content

Commit d01098a

Browse files
committed
Mention how to extend syntax highlighting in the README
1 parent a320eab commit d01098a

1 file changed

Lines changed: 21 additions & 18 deletions

File tree

README.md

Lines changed: 21 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,13 @@ ExDoc ships with many features:
2828
* Show tooltips when mousing over a link to a module/function (works for the current project and across projects)
2929
* A version dropdown to quickly switch to other versions (automatically configured when hosted on HexDocs)
3030

31-
## Using ExDoc with Mix
31+
## Usage
3232

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.
3434

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:
3638

3739
```elixir
3840
def deps do
@@ -42,11 +44,7 @@ def deps do
4244
end
4345
```
4446

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.
5048

5149
> #### Erlang development environment {: .warning}
5250
>
@@ -76,7 +74,11 @@ end
7674

7775
Now you are ready to generate your project documentation with `mix docs`. To see all options available when generating docs, run `mix help docs`.
7876

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
8082

8183
You can ExDoc via the command line as follows:
8284

@@ -107,9 +109,15 @@ For example, here are some acceptable values:
107109
GITHUB_USER => elixir-lang
108110
GITHUB_REPO => ecto
109111

110-
## Using ExDoc with Erlang projects
112+
## Syntax highlighting
111113

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:
115+
116+
```elixir
117+
{:makeup_html, ">= 0.0.0", only: :dev, runtime: false}
118+
```
119+
120+
You can find all support languages [under the Makeup organization on GitHub](https://github.com/elixir-makeup).
113121

114122
## Metadata
115123

@@ -148,16 +156,11 @@ ExDoc supports linking to modules (`` `MyModule` ``), functions (`` `MyModule.fu
148156

149157
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`) ``.
150158

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`.
153160

154161
## Admonition blocks
155162

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`.
161164

162165
The syntax is as follows:
163166

0 commit comments

Comments
 (0)