-
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.
Add "coqdoc_header" and "coqdoc_footer" fields.
Signed-off-by: Rodolphe Lepigre <[email protected]>
- Loading branch information
Showing
13 changed files
with
222 additions
and
8 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
- Add `coqdoc_header` and `coqdoc_footer` fields to the `coq` field of the | ||
`env` stanza, and to the `coq.theory` stanza, allowing to configure a | ||
custom header or footer respectively in the HTML output of `coqdoc`. | ||
(#11131, @rlepigre) |
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
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 |
---|---|---|
@@ -1,8 +1,12 @@ | ||
open Import | ||
|
||
type t = | ||
{ coq_flags : string list | ||
; coqdep_flags : string list | ||
; coqdoc_flags : string list | ||
; coqdoc_header : Path.t option | ||
; coqdoc_footer : Path.t option | ||
} | ||
|
||
val default : t | ||
val dump : t -> Dune_lang.t list | ||
val dump : dir:Path.t -> t -> Dune_lang.t list |
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
31 changes: 31 additions & 0 deletions
31
test/blackbox-tests/test-cases/coq/coqdoc-flags-header-footer-gen.t
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,31 @@ | ||
Testing the coqdoc_header and coqdoc_footer field of the env stanza. | ||
|
||
$ cat > dune-project <<EOF | ||
> (lang dune 3.17) | ||
> (using coq 0.10) | ||
> EOF | ||
|
||
$ cat > dune <<EOF | ||
> (rule (with-stdout-to header.%{coq:version}.html (echo "HEADER"))) | ||
> (rule (with-stdout-to footer.html (echo "FOOTER"))) | ||
> (env | ||
> (_ | ||
> (coq | ||
> (coqdoc_header header.%{coq:version}.html) | ||
> (coqdoc_footer footer.html)))) | ||
> (coq.theory | ||
> (name a)) | ||
> EOF | ||
$ cat > foo.v <<EOF | ||
> Definition a := 42. | ||
> EOF | ||
|
||
$ dune build @doc | ||
$ find _build/default/a.html -type f -name '*.html' | sort | xargs grep HEADER | ||
_build/default/a.html/a.foo.html:HEADER | ||
_build/default/a.html/index.html:HEADER | ||
_build/default/a.html/toc.html:HEADER | ||
$ find _build/default/a.html -type f -name '*.html' | sort | xargs grep FOOTER | ||
_build/default/a.html/a.foo.html:FOOTER | ||
_build/default/a.html/index.html:FOOTER | ||
_build/default/a.html/toc.html:FOOTER |
41 changes: 41 additions & 0 deletions
41
test/blackbox-tests/test-cases/coq/coqdoc-flags-header-footer.t
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,41 @@ | ||
Testing the coqdoc_header and coqdoc_footer field of the env stanza. | ||
|
||
$ cat > dune-project <<EOF | ||
> (lang dune 3.17) | ||
> (using coq 0.10) | ||
> EOF | ||
|
||
$ cat > dune <<EOF | ||
> (env | ||
> (_ | ||
> (coq | ||
> (coqdoc_header header.html) | ||
> (coqdoc_footer footer.html)))) | ||
> (coq.theory | ||
> (name a)) | ||
> EOF | ||
$ cat > foo.v <<EOF | ||
> Definition a := 42. | ||
> EOF | ||
$ cat > header.html <<EOF | ||
> header | ||
> EOF | ||
$ cat > footer.html <<EOF | ||
> footer | ||
> EOF | ||
|
||
$ dune build @doc | ||
|
||
$ tail _build/log -n 1 | ./scrub_coq_args.sh | sed 's/.*coq/coq/' | ||
coqdoc | ||
coq/theories Coq | ||
-R . a --toc --with-header header.html --with-footer footer.html --html -d a.html | ||
foo.v | ||
$ dune build @doc-latex | ||
$ tail _build/log -n 1 | ./scrub_coq_args.sh | sed 's/.*coq/coq/' | ||
coqdoc | ||
coq/theories Coq | ||
-R . a --toc --latex -d a.tex | ||
foo.v |
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