3a977a94ca
- Makes the autocomplete results highlight with up/down arrows. - Allows you to unselect autocomplete results by using arrow keys. - Fixed a bug in previous commits where enter did not take you to autocomplete result. - Return now goes to the search page if no autocomplete result is selected. - Search results table now properly wraps. (It would be nice to make it wider but I wasn't able to). - Fixed a bug in the previous commit where docs were not showing, due to failure to copy a modified js file. |
||
---|---|---|
.github/workflows | ||
DocGen4 | ||
static | ||
.gitignore | ||
DocGen4.lean | ||
LICENSE | ||
Main.lean | ||
README.md | ||
deploy_docs.sh | ||
lake-manifest.json | ||
lakefile.lean | ||
lean-toolchain |
README.md
doc-gen4
Document Generator for Lean 4
Usage
doc-gen4
is the easiest to use via its custom Lake facet, in order
to do this you have to add it to your lakefile.lean
like this:
meta if get_config? env = some "dev" then -- dev is so not everyone has to build it
require «doc-gen4» from git "https://github.com/leanprover/doc-gen4" @ "main"
Then you can generate documentation for an entire library using:
lake -Kenv=dev build Test:docs
If you have multiple libraries you want to generate documentation for the recommended way right now is to run it for each library.
Development of doc-gen4
You can build docs using a modified doc-gen4
as follows: Replace the from git "..." @ "main"
in the lakefile.lean
with just from "..."
using the path to the modified version of doc-gen4
. E.g. if the
path to the modified version of doc-gen4
is ../doc-gen4
, it would be:
meta if get_config? env = some "dev" then -- dev is so not everyone has to build it
require «doc-gen4» from "../doc-gen4"
The root of the built docs will be build/docs/index.html
. However, due to the "Same Origin Policy", the
generated website will be partially broken if you just open the generated html files in your browser. You
need to serve them from a proper http server for it to work. An easy way to do that is to run
python3 -m http.server
from the build/docs
directory.