Skip to content

Commit 5df7965

Browse files
authored
Golf scripts/build_docs.sh (#43)
1 parent b1def00 commit 5df7965

File tree

1 file changed

+6
-14
lines changed

1 file changed

+6
-14
lines changed

scripts/build_docs.sh

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
# Build HTML documentation for add-combi
22
# The output will be located in docs/build
33

4-
# Template lakefile.toml
5-
template() {
6-
cat <<EOF
4+
# Create a temporary docbuild folder
5+
mkdir -p docbuild
6+
7+
# Equip docbuild with this template lakefile.toml
8+
cat << EOF > docbuild/lakefile.toml
79
name = "docbuild"
810
reservoir = false
911
version = "0.1.0"
@@ -16,18 +18,8 @@ path = "../"
1618
[[require]]
1719
scope = "leanprover"
1820
name = "doc-gen4"
19-
rev = "TOOLCHAIN"
21+
rev = "$(< lean-toolchain cut -f 2 -d: )"
2022
EOF
21-
}
22-
23-
# Create a temporary docbuild folder
24-
mkdir -p docbuild
25-
26-
# Equip docbuild with the template lakefile.toml
27-
template > docbuild/lakefile.toml
28-
29-
# Substitute the toolchain from lean-toolchain into docbuild/lakefile.toml
30-
sed -i s/TOOLCHAIN/`grep -oP 'v4\..*' lean-toolchain`/ docbuild/lakefile.toml
3123

3224
# Fetch the docs cache if it exists
3325
mkdir -p website/docs

0 commit comments

Comments
 (0)