-
Notifications
You must be signed in to change notification settings - Fork 413
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Record the fact that odoc reads ODOC_SYNTAX
This controls the syntax of the output. Closes #1117 Signed-off-by: Etienne Millon <me@emillon.org>
- Loading branch information
Showing
3 changed files
with
107 additions
and
63 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
The rules that call odoc know that it is going to read the ODOC_SYNTAX | ||
variable, and can rebuild as needed. | ||
|
||
$ cat > dune-project << EOF | ||
> (lang dune 1.1) | ||
> (package (name l)) | ||
> EOF | ||
|
||
$ cat > dune << EOF | ||
> (library | ||
> (public_name l)) | ||
> EOF | ||
|
||
$ cat > l.ml << EOF | ||
> module type X = sig end | ||
> EOF | ||
|
||
$ detect () { | ||
> if grep -q '>sig<' $1 ; then | ||
> echo it is ocaml | ||
> elif grep -q '{ ... }' $1 ; then | ||
> echo it is reason | ||
> else | ||
> echo it is unknown | ||
> fi | ||
> } | ||
|
||
$ dune build @doc | ||
$ detect _build/default/_doc/_html/l/L/index.html | ||
it is ocaml | ||
|
||
$ ODOC_SYNTAX=re dune build @doc | ||
$ detect _build/default/_doc/_html/l/L/index.html | ||
it is reason |