Generated from
folio-assistant-sci/skills/content/folio-paper-adapter/build-docs.md— do not edit here.
/build-docs
Builds the Lean HTML documentation using doc-gen4 locally, to save CI
minutes.
Resolve the paper first
This skill is content-agnostic — it takes the paper directory and Lake target as inputs rather than assuming a particular folio’s layout.
# List the folio's papers (each has <paper>/<paper>.ts)
ls content/*/[!.]*.ts | xargs -n1 dirname | sort -u
Then set, for the paper you are building:
PAPER— the paper directory undercontent/LEAN_DIR— normallycontent/$PAPER/leanDOC_TARGET— the Lake docs target, read from the package name in$LEAN_DIR/lakefile.toml(<PackageName>:docs)
Never hardcode a paper name here. If a folio has exactly one paper the
ls above resolves it unambiguously; if it has several, ask which one.
Behavior
cd "$LEAN_DIR"Uncomment the
doc-gen4dependency inlakefile.toml(commented out by default so ordinary builds stay fast):sed -i.bak \ -e 's/# \[\[require\]\]/[[require]]/' \ -e 's/# name = "doc-gen4"/name = "doc-gen4"/' \ -e 's|# git = "https://github.com/leanprover/doc-gen4"|git = "https://github.com/leanprover/doc-gen4"|' \ -e 's/# rev = /rev = /' \ lakefile.toml && rm -f lakefile.toml.baksed -i.bak … && rmis used because baresed -idiffers between GNU and BSD/macOS; the suffix form works on both. (The previous version of this skill hardcoded the macOSsed -i ''spelling, which fails on the Linux CI image.)Update and build:
lake update doc-gen4 lake -R -Kenv=dev build "$DOC_TARGET"Restore
lakefile.tomlso thedoc-gen4dependency is not committed:git checkout lakefile.tomlDo this even if the build failed — a modified
lakefile.tomlleft behind will slow every subsequent build and may be committed by accident.Report the output location:
$LEAN_DIR/.lake/build/doc.