Document generator for my Bookshelf project
 
 
 
 
Go to file
Henrik Böving 6534a71cca chore: update toolchain 2022-08-11 18:30:28 +02:00
.github/workflows feat: update CI and README 2022-06-20 23:04:03 +02:00
DocGen4 chore: update toolchain 2022-08-11 18:30:28 +02:00
lean_packages chore: update toolchain 2022-08-11 18:30:28 +02:00
static feat: instances for 2022-07-23 15:40:08 +02:00
.gitignore feat: importedBy via Javascript 2022-07-22 16:56:51 +02:00
DocGen4.lean chore: update toolchain 2022-08-11 18:30:28 +02:00
LICENSE Initial commit 2021-11-10 17:41:28 -08:00
Main.lean feat: Degrade --ink to flag 2022-07-26 13:56:22 +02:00
README.md chore: README alignment 2022-07-21 23:05:10 +02:00
deploy_docs.sh feat: update CI and README 2022-06-20 23:04:03 +02:00
lakefile.lean chore: update toolchain 2022-08-11 18:30:28 +02:00
lean-toolchain chore: update toolchain 2022-08-11 18:30:28 +02:00

README.md

doc-gen4

Document Generator for Lean 4

Usage

You can call doc-gen4 from the top of a Lake project like this:

$ /path/to/doc-gen4 Module

where Module is one or more of the top level modules you want to document. The tool will then proceed to compile the project using lake (if that hasn't happened yet), analyze it and put the result in ./build/doc.

You can optionally provide the path to a LeanInk binary using the --ink flag which will make the tool produce Alectryon style rendered output along the usual documentation.

You could e.g. host the files locally with the built-in Python webserver:

$ cd build/doc && python -m http.server

Multi stage

You can also use doc-gen4 in multiple separate stages to generate the whole documentation. For example mathlib4 consists out of 4 modules, the 3 Lean compiler ones and itself:

  • Init
  • Std
  • Lean
  • Mathlib

The first build stage is to run doc-gen for all modules separately:

  1. doc-gen4 single Init
  2. doc-gen4 single Std
  3. doc-gen4 single Lean
  4. doc-gen4 single Mathlib

Note that you can also just make a call to submodules so Mathlib.Algebra will work standalone as well. Furthermore one can use the --ink flag here to also generate LeanInk documentation in addition.

The second and last stage is the index one which zips up some information relevant for the search:

$ doc-gen4 index Mathlib

Now build/doc should contain the same files with the same context as if one had run

$ doc-gen4 Mathlib