Workaround 2 - % sign in a filename.

This commit is contained in:
Patrick Lehmann
2024-12-24 12:20:34 +01:00
parent a4559e8e63
commit c37f727e2d
2 changed files with 34 additions and 2 deletions

View File

@@ -59,7 +59,6 @@ jobs:
run: | run: |
tree -pash . tree -pash .
- name: Build LaTeX document using 'pytooling/miktex:sphinx' - name: Build LaTeX document using 'pytooling/miktex:sphinx'
uses: addnab/docker-run-action@v3 uses: addnab/docker-run-action@v3
with: with:
@@ -70,7 +69,7 @@ jobs:
pwd pwd
ls -lAh ls -lAh
latexmk ${{ inputs.document }}.tex latexmk -xelatex ${{ inputs.document }}.tex
- name: 📤 Upload 'PDF Documentation' artifact - name: 📤 Upload 'PDF Documentation' artifact
uses: pyTooling/upload-artifact@v4 uses: pyTooling/upload-artifact@v4

View File

@@ -180,6 +180,39 @@ jobs:
sphinx-build -v -n -b latex -d _build/doctrees -j $(nproc) -w _build/latex.log . _build/latex 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 # --builder html --doctree-dir _build/doctrees --verbose --fresh-env --write-all --nitpicky --warning-file _build/html.log . _build/html
- name: Workaround II - https://github.com/sphinx-doc/sphinx/issues/13189
if: inputs.latex_artifact != ''
run: |
printf "Changing directory to 'doc/_build/latex' ...\n"
cd doc/_build/latex
printf "Searching for downloaded images, that need normalization ...\n"
for imageExt in png svg jpg jpeg; do
printf " Processing '%s' ...\n" "${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" *.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 - name: 📤 Upload 'LaTeX Documentation' artifact
if: inputs.latex_artifact != '' if: inputs.latex_artifact != ''
continue-on-error: true continue-on-error: true