Skip to content

Commit

Permalink
Workaround 1 - % sign in a filename.
Browse files Browse the repository at this point in the history
  • Loading branch information
Paebbels committed Dec 24, 2024
1 parent a4559e8 commit e5d586b
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 2 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/LaTeXDocumentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ jobs:
run: |
tree -pash .
- name: Build LaTeX document using 'pytooling/miktex:sphinx'
uses: addnab/docker-run-action@v3
with:
Expand All @@ -70,7 +69,7 @@ jobs:
pwd
ls -lAh
latexmk ${{ inputs.document }}.tex
latexmk -xelatex ${{ inputs.document }}.tex
- name: 📤 Upload 'PDF Documentation' artifact
uses: pyTooling/upload-artifact@v4
Expand Down
30 changes: 30 additions & 0 deletions .github/workflows/SphinxDocumentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,36 @@ 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/13189
if: inputs.latex_artifact != ''
run: |
printf "Searching for downloaded images, that need normalization ...\n"
for imageExt in png svg jpg jpeg; do
printf " Processing '%s' ..." "${imageExt}"
while IFS=$'\n' read -r imageFile; do
newFile="${imageFile//%/_}";
printf " %s\n" "$imageFile";
if [[ "${imageFile}" != "${newFile}" ]]; then
printf " Rename file to '%s' " "${newFile}"
mv "${imageFile}" "${newFile}"
if [[ $? -eq 0 ]]; then
printf "[OK]\n"
else
printf "[FAILED]\n"
fi
printf " Patching LaTeX file for '%s' " "${newFile}"
sed -i "s/\{\{${imageFile%.*}\}\.${imageFile##*.}\}/{{${newFile%.*}}.${newFile##*.}}/g" _build/latex/*.tex
if [[ $? -eq 0 ]]; then
printf "[OK]\n"
else
printf "[FAILED]\n"
fi
fi
done <<<$(find . -type f -iname "*.$imageExt" | sed 's:./::')
done
- name: 📤 Upload 'LaTeX Documentation' artifact
if: inputs.latex_artifact != ''
continue-on-error: true
Expand Down

0 comments on commit e5d586b

Please sign in to comment.