diff --git a/.github/workflows/SphinxDocumentation.yml b/.github/workflows/SphinxDocumentation.yml index ae557070..76dabfbe 100644 --- a/.github/workflows/SphinxDocumentation.yml +++ b/.github/workflows/SphinxDocumentation.yml @@ -180,6 +180,39 @@ jobs: sphinx-build -v -n -b latex -d _build/doctrees -j $(nproc) -w _build/latex.log . _build/latex # --builder html --doctree-dir _build/doctrees --verbose --fresh-env --write-all --nitpicky --warning-file _build/html.log . _build/html + - name: Workaround I - https://github.com/sphinx-doc/sphinx/issues/13190 + if: inputs.latex_artifact != '' + run: | + printf "Changing directory to 'doc/_build/latex' ...\n" + cd doc/_build/latex + + printf "Changing file extension according to MIME type ...\n" + while IFS=$'\n' read -r file; do + printf " Checking '%s* ... " "${file}" + mime="$(file --mime-type -b "${file}")" + printf "[%s]" "${mime}" + case "${mime}" in + image/png) + if [[ "${file##*.}" != "png" ]]; then + printf " Rename file to '%s' " "${file}.png" + mv "${file}" "${file}.png" + if [[ $? -eq 0 ]]; then + printf "[OK]\n" + else + printf "[FAILED]\n" + fi + + printf " Patching LaTeX file for '%s' " "${file}" + else + printf "unchanged" + fi + ;; + *) + printf " Unandled '%s'\n" "${file}" + ;; + esac + done <<<$(find . -type f -not -iname "*.sty" -not -iname "*.svg" -not -iname "*.png" -not -iname "*.jpg" | sed 's:./::') + - name: Workaround II - https://github.com/sphinx-doc/sphinx/issues/13189 if: inputs.latex_artifact != '' run: |