doc-status/build.sh

31 lines
948 B
Bash
Raw Normal View History

2020-02-26 19:56:46 +01:00
#!/usr/bin/env bash
set -euo pipefail
IFS='$\n\t'
TMP="$(mktemp -d)"
git clone --depth=1 https://github.com/godotengine/godot.git "$TMP"
# Generate a Markdown table of the class reference coverage.
mkdir -p content/
2020-02-26 22:03:53 +01:00
rm -f content/_index.md
2020-02-26 19:56:46 +01:00
# Add Git commit information to the generated page.
2020-02-26 22:03:53 +01:00
# Must end with a blank line so the table that will be appended can be parsed correctly.
2020-02-26 19:56:46 +01:00
COMMIT_HASH="$(git -C "$TMP" rev-parse --short=9 HEAD)"
2020-02-26 22:03:53 +01:00
cat << EOF > content/_index.md
# Godot class reference status
Generated from Godot commit [$COMMIT_HASH](https://github.com/godotengine/godot/commit/$COMMIT_HASH).
EOF
2020-02-26 19:56:46 +01:00
# Trim the first line of the output to get a valid Markdown table.
# Ensure that module documentation is also included in the report.
python3 "$TMP/doc/tools/doc_status.py" -u "$TMP/doc/classes" "$TMP"/modules/*/doc_classes | tail -n +2 >> content/_index.md
2020-02-26 19:56:46 +01:00
# Build the website with optimizations enabled.
hugo --minify
2020-02-26 19:56:46 +01:00
rm -rf "$TMP"