|
| 1 | +# CoqdocJS |
| 2 | + |
| 3 | +CoqdocJS is a little script to dynamically improve the coqdoc output. |
| 4 | +The result can be seen here: |
| 5 | + |
| 6 | +https://www.ps.uni-saarland.de/autosubst/doc/Ssr.POPLmark.html |
| 7 | + |
| 8 | +It offers the following features: |
| 9 | +- Customizable Unicode display: |
| 10 | + It only changes the display, copy-paste from the website produces pure ASCII. |
| 11 | + It only replaces complete identifiers or notation tokens, possibly terminated by numbers or apostrophes. |
| 12 | + It does not replace randomly, like in "omega." or "tauto." |
| 13 | + To add new symbols, edit [config.js](extra/resources/config.js). |
| 14 | +- Proof hiding: |
| 15 | + All proofs longer than one line are hidden by default. They can be uncovered by clicking on "Proof...". |
| 16 | + |
| 17 | +All of this works with the ordinary coqdoc, by asking coqdoc to use a header file including the javascript files and some custom CSS. |
| 18 | + |
| 19 | +## Usage |
| 20 | + |
| 21 | +1. Clone this repository as a subdirectory or submodule; |
| 22 | +2. Include [Makefile.doc] in your `Makefile`, or copy it as, e.g., `Makefile.coq.local`; |
| 23 | +3. Run `make coqdoc` to build documentations. |
| 24 | + |
| 25 | +A minimal example is shown [here](example). |
| 26 | + |
| 27 | +### Environment Variables |
| 28 | +Name | Usage | Default |
| 29 | +---|---|--- |
| 30 | +`COQDOCFLAGS` | Override the flags passed to `coqdoc` | see [Makefile.doc] |
| 31 | +`COQDOCEXTRAFLAGS` | Extend the flags passed to `coqdoc` | empty |
| 32 | +`COQDOCJS_LN` | If set to `true` then symlink resource files; otherwise copy | `false` |
| 33 | +`COQDOCJS_DIR` | Folder containing CoqdocJS | `coqdocjs` |
| 34 | +`COQMAKEFILE` | Makefile generated by `coq_makefile` | `Makefile.coq` |
| 35 | + |
| 36 | +## Files |
| 37 | + |
| 38 | +- [Makefile.doc]: a generic Makefile setup that calls coqc and coqdoc with the right parameters |
| 39 | +- [config.js](extra/resources/config.js): contains the unicode replacement table |
| 40 | +- [coqdoc.css](extra/resources/coqdoc.css): a replacement for the default Coqdoc CSS style. Can be removed to use the default style |
| 41 | +- [coqdocjs.js](extra/resources/coqdocjs.js) and [coqdocjs.css](extra/resources/coqdocjs.css): the script rewriting the DOM and adding the dynamic features with a corresponding CSS style |
| 42 | +- [header.html](extra/header.html) and [footer.html](extra/footer.html): custom header and footer files used in every generated html file |
| 43 | + |
| 44 | +[Makefile.doc]: Makefile.doc |
0 commit comments