Docs: Add Sphinx-based manual

This commit is contained in:
Ole Schütt 2023-06-06 22:20:50 +02:00 committed by Ole Schütt
parent 03f49e929a
commit 934a489bed
16 changed files with 508 additions and 8 deletions

View file

@ -25,8 +25,9 @@ pip3 install --quiet \
numpy \
matplotlib \
requests \
types-lxml \
types-requests \
mypy==0.991
mypy==1.3.0
# download inputs for minimax_to_fortran_source.py
wget -q https://www.cp2k.org/static/downloads/1_xData.zip

View file

@ -29,9 +29,13 @@ echo -e "\n========== Installing Dependencies =========="
apt-get update -qq
apt-get install -qq --no-install-recommends \
default-jre-headless \
libsaxonhe-java
libsaxonhe-java \
python3 \
python3-pip
rm -rf /var/lib/apt/lists/*
pip3 install --quiet sphinx myst-parser sphinx_rtd_theme lxml
echo -e "\n========== Generating Manual =========="
mkdir -p /workspace/artifacts/manual
@ -53,13 +57,27 @@ set +e # disable error trapping for remainder of script
$SAXON -o:cp2k.vim ./cp2k_input.xml ${TOOLS}/input_editing/vim/vim.xsl
)
EXIT_CODE=$?
if ((EXIT_CODE)); then
echo -e "\nSummary: Something is wrong."
echo -e "\nSummary: Saxon run failed."
echo -e "Status: FAILED\n"
else
echo -e "\nSummary: Manual generation works fine."
echo -e "Status: OK\n"
exit
fi
echo -e "\n========== Generating New Manual =========="
(
set -e # abort if error is encountered
/opt/cp2k/docs/generate_input_reference.py ./cp2k_input.xml ./references.html
echo ""
sphinx-build /opt/cp2k/docs/ /workspace/artifacts/manual/new --jobs 16
)
EXIT_CODE=$?
if ((EXIT_CODE)); then
echo -e "\nSummary: Sphinx build failed"
echo -e "Status: FAILED\n"
exit
fi
echo -e "\nSummary: Manual generation works fine."
echo -e "Status: OK\n"
#EOF

View file

@ -41,6 +41,7 @@ run_test mypy --strict ./tools/precommit/format_makefile.py
run_test mypy --strict ./tools/docker/generate_dockerfiles.py
run_test mypy --strict ./tools/apptainer/generate_apptainer_def_files.py
run_test mypy --strict ./tools/conventions/analyze_gfortran_ast.py
run_test mypy --strict ./docs/generate_input_reference.py
# TODO: Find a way to test generate_dashboard.py without git repository.
#