lean-flt / scripts /build_docs.sh
cfahlgren1's picture
cfahlgren1 HF Staff
mirror at 019805815d7da565ed1e9f427b6fbd0cbc9d00d3
ae5bbef verified
Raw History Blame Contribute Delete
942 Bytes
#!/usr/bin/env bash
# Exit immediately if a command exits with a non-zero status,
# treat unset variables as an error, and ensure errors in pipelines are not masked.
set -euo pipefail
# Build HTML documentation for FLT
# The output will be located in docs/docs
# Create a temporary docbuild folder
mkdir -p docbuild
# Template lakefile.toml
cat << EOF > docbuild/lakefile.toml
name = "docbuild"
reservoir = false
version = "0.1.0"
packagesDir = "../.lake/packages"
[[require]]
name = "FLT"
path = "../"
[[require]]
scope = "leanprover"
name = "doc-gen4"
rev = "$(< lean-toolchain cut -f 2 -d: )"
EOF
# Initialise docbuild as a Lean project
cd docbuild
# Disable an error message due to a non-blocking bug. See Zulip
MATHLIB_NO_CACHE_ON_UPDATE=1 ~/.elan/bin/lake update FLT
# Build the docs
~/.elan/bin/lake build FLT:docs
# Copy documentation to `docs/docs`
cd ../
sudo chown -R runner docs
cp -r docbuild/.lake/build/doc docs/docs