Repository navigation
Fix PDF build by removing incompatible emoji characters - #2152
nehasanoor2006-collab wants to merge 2 commits into
Conversation
|
This removes some personality, even changes output from a tool. What about this alternative idea: keep the emojis, hook a script that replaces them with ascii emoticons or removes them for the PDF build. (Please disclose if you use chatbots to create code or messages) |
|
Thanks for the suggestion! I agree that removing the emojis from the documentation changes the original presentation. I'll look into keeping the emojis in the source while handling them specifically for the PDF build. |
|
I agree with @merwok. Especially since the GHA workflow gets copied and works in the current format. A PDF-scoped transformer would be preferred. Make sure to have it integrated into the current infra and not run arbitrary low-level disconnected commands for testing as many agents like to do. |
|
Could you get rid of the commit that removes the emojis in the first place so that it doesn't contaminate git blame? Also, why does your username say "collab"? Note that in open source, it's common curtesy to talk to people to reach agreement and not replace that with pushing new commits like many agents like to do. |
|
Thanks for the feedback. I understand your point about keeping the commit history clean and discussing the approach before pushing changes. I used AI assistance during the investigation and implementation, and I should have discussed the revised approach before pushing the new commit. The I'll clean up the PR history so the original emoji-removal commit isn't retained, while preserving the final PDF-scoped solution. I'll also make sure to discuss any further changes before pushing them. |
Fixes #2031.
The PDF build uses Sphinx's LaTeX builder with pdflatex, which has limited support for Unicode characters such as emoji. These characters can cause the LaTeX build to fail before the table of contents is fully generated.
Instead of removing the emojis from the documentation source, this change adds a LaTeX-only Sphinx post-transform that sanitizes the affected decorative emoji characters during PDF generation.
This keeps the original source content and HTML output unchanged while preventing the problematic characters from reaching the LaTeX/PDF output.
Testing
python3 -m nox -s build— passedpython3 -m nox -s checkqa— passedpython3 -m sphinx -b latex -d /tmp/pyproject-doctrees source /tmp/pyproject-latex— passedgit diff --check— passed