-
Notifications
You must be signed in to change notification settings - Fork 412
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The `odoc` tool supports a `--as-json` flag. When used in `odoc html-generate`, it will output `.html.json` files instead of `.html` files. These files contain HTML fragments that can be used by external tools to generate HTML documents using a different pipeline. This is exposed in Dune by defining a new `@doc-json` alias that works like `@doc` (it builds the documentation for public packages) but emits JSON files. Signed-off-by: Etienne Millon <me@emillon.org>
- Loading branch information
Showing
4 changed files
with
120 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
$ cat > dune-project << EOF | ||
> (lang dune 3.10) | ||
> | ||
> (package | ||
> (name l)) | ||
> EOF | ||
|
||
$ cat > dune << EOF | ||
> (library | ||
> (public_name l)) | ||
> EOF | ||
|
||
$ cat > l.ml << EOF | ||
> module M = struct | ||
> type t = int | ||
> end | ||
> EOF | ||
|
||
$ dune build @doc-json | ||
|
||
$ find _build/default/_doc/_html/ -name '*.html' -o -name '*.html.json' | ||
_build/default/_doc/_html/l/index.html.json | ||
_build/default/_doc/_html/l/L/M/index.html.json | ||
_build/default/_doc/_html/l/L/index.html.json |