add build/serve docs commands to manage script

This commit is contained in:
Ondřej Samohel 2025-03-17 17:03:48 +01:00
parent 3e06feb224
commit e388bc5030
No known key found for this signature in database
GPG key ID: 02376E18990A97C6
2 changed files with 57 additions and 0 deletions

View file

@ -159,6 +159,8 @@ default_help() {
echo -e " ${BWhite}codespell${RST} ${BCyan}Run codespell check for the repository${RST}"
echo -e " ${BWhite}run${RST} ${BCyan}Run a poetry command in the repository environment${RST}"
echo -e " ${BWhite}run-tests${RST} ${BCyan}Run ayon-core tests${RST}"
echo -e " ${BWhite}build-docs${RST} ${BCyan}Build documentation${RST}"
echo -e " ${BWhite}serve-docs${RST} ${BCyan}Local serve documentation${RST}"
echo ""
}
@ -189,6 +191,20 @@ run_tests () {
"$POETRY_HOME/bin/poetry" run pytest ./tests
}
build_docs () {
echo -e "${BIGreen}>>>${RST} Cleaning cache files ..."
clean_pyc
echo -e "${BIGreen}>>>${RST} Building docs..."
"$POETRY_HOME/bin/poetry" run mkdocs build
}
serve_docs () {
echo -e "${BIGreen}>>>${RST} Cleaning cache files ..."
clean_pyc
echo -e "${BIGreen}>>>${RST} Building docs..."
"$POETRY_HOME/bin/poetry" run mkdocs serve
}
main () {
detect_python || return 1
@ -229,6 +245,14 @@ main () {
run_tests "$@" || return_code=$?
exit $return_code
;;
"builddocs")
build_docs "$@" || return_code=$?
exit $return_code
;;
"servedocs")
serve_docs "$@" || return_code=$?
exit $return_code
;;
esac
if [ "$function_name" != "" ]; then