Skip to content

Commit

Permalink
Workaround 1 - missing file extensions.
Browse files Browse the repository at this point in the history
  • Loading branch information
Paebbels committed Dec 24, 2024
1 parent c37f727 commit 7680dba
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/SphinxDocumentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand Down

0 comments on commit 7680dba

Please sign in to comment.