Use an heredoc for the page header

This commit is contained in:
Hugo Locurcio
2020-02-26 22:03:53 +01:00
parent f69e63d931
commit a0712e78f0
2 changed files with 9 additions and 3 deletions

View File

@@ -1,6 +1,6 @@
os: linux
dist: bionic
# Python is required to run `doc_status.py`
# Python is required to run `doc_status.py`.
language: python
python:

View File

@@ -8,11 +8,17 @@ git clone --depth=1 https://github.com/godotengine/godot.git "$TMP"
# Generate a Markdown table of the class reference coverage.
mkdir -p content/
rm -f content/index.md
rm -f content/_index.md
# Add Git commit information to the generated page.
# Must end with a blank line so the table that will be appended can be parsed correctly.
COMMIT_HASH="$(git -C "$TMP" rev-parse --short=9 HEAD)"
echo -e "Generated from commit [$COMMIT_HASH](https://github.com/godotengine/godot/commit/$COMMIT_HASH).\n" > content/_index.md
cat << EOF > content/_index.md
# Godot class reference status
Generated from Godot commit [$COMMIT_HASH](https://github.com/godotengine/godot/commit/$COMMIT_HASH).
EOF
# Trim the first line of the output to get a valid Markdown table.
python3 "$TMP/doc/tools/doc_status.py" -u "$TMP/doc/classes" | tail -n +2 >> content/_index.md