Skip to content

Commit 571f4e9

Browse files
(doc) how to generate odoc .mld documentation pages with dune (#1882)
* add a section on how to generate odoc documentation pages with dune * minor formatting fixes --------- Co-authored-by: Christine Rose <[email protected]>
1 parent f35fde4 commit 571f4e9

File tree

1 file changed

+23
-1
lines changed

1 file changed

+23
-1
lines changed

data/tutorials/platform/bp_08_odoc.md

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ description: |
66
category: "Best Practices"
77
---
88

9-
# Generating Documentation With Odoc
9+
# Generating Documentation With `odoc`
1010

1111
The documentation rendering tool `odoc` generates documentation
1212
in the form of HTML, LaTeX, or man pages,
@@ -23,3 +23,25 @@ $ open _build/default/_doc/_html/index.html
2323
# Windows
2424
$ explorer _build\default\_doc\_html\index.html
2525
```
26+
27+
## Generating `.mld` Documentation Pages
28+
29+
In addition to documenting the publicly-visible API of your project,
30+
`odoc` also gives you the ability to add individual documentation pages.
31+
32+
For example, to replace the automatically generated documentation
33+
index file, you have to add a file `index.mld` to your project.
34+
35+
To make Dune find your `.mld` pages and process them with `odoc`,
36+
the `dune` file in the same directory as your `.mld` files needs to
37+
include this stanza:
38+
39+
```
40+
(documentation
41+
(package name-of-your-package))
42+
```
43+
44+
A common place to put `.mld` files is a folder named `doc` or `docs`.
45+
46+
For more information on how to write documentation pages for `odoc`,
47+
see the [`odoc` for authors documentation](https://ocaml.github.io/odoc/odoc_for_authors.html#doc-pages).

0 commit comments

Comments
 (0)