feat: Always document the transitive closure of a module

main
Henrik Böving 2023-10-07 21:07:55 +02:00
parent 649e7791fa
commit fa8c9d771a
2 changed files with 13 additions and 5 deletions

View File

@ -14,12 +14,17 @@ Then update your dependencies:
lake -Kenv=dev update
```
Then you can generate documentation for an entire library using:
Then you can generate documentation for an entire library and all files imported
by that 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.
If you have multiple libraries you want to generate full documentation for:
```
lake -Kenv=dev build Test:docs Foo:docs
```
Note that doc-gen currently always generates documentation for `Lean`, `Init`
and `Lake` in addition to the provided targets.
## 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

View File

@ -29,6 +29,9 @@ module_facet docs (mod) : FilePath := do
let exeJob ← docGen4.exe.fetch
let modJob ← mod.leanArts.fetch
let buildDir := (← getWorkspace).root.buildDir
-- Build all documentation imported modules
let imports ← mod.imports.fetch
imports.forM fun mod => discard <| fetch <| mod.facet `docs
let docFile := mod.filePath (buildDir / "doc") "html"
exeJob.bindAsync fun exeFile exeTrace => do
modJob.bindSync fun _ modTrace => do