Improve pdf styling - #50
Conversation
39d115c to
17102df
Compare
17102df to
786620e
Compare
|
This is what the produced PDF looks like. @emmajclegg - any feedback on how the PDF looks? The code works, and I've refined a bit over running it a few times. I've only tested it in the devcontainer build. I had Claude write me a primer for LaTeX styling; I've read that and checked it in. I've not verified every detail, but it seems to track with what's in the document code. I don't like how this solution currently checks in fonts and styling choices from the design system that may change. I'd like to explore if we can pull more of that stuff in at build time, maybe version-control it with the design system itself. cc @IATI/devs for awareness |
Sphinx's LaTeX builder only accepts PDF/PNG/JPEG images, so SVGs referenced in docs were silently dropped from PDF downloads while PNG/JPEG rendered fine. Register sphinxcontrib.rsvgconverter in the theme's setup() so SVGs are converted to PDF (as vectors, via rsvg-convert) during the LaTeX build. This applies to every consumer site automatically, alongside the existing config-inited LaTeX wiring - the converter is inert for HTML and importing it can never break HTML builds. Add the converter as a theme dependency, and install librsvg2-bin (which provides rsvg-convert) in the Read the Docs and devcontainer build environments. Add a vector SVG to the kitchen-sink docs to exercise the conversion in the PDF build. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The kitchen-sink pages are copied in from sphinx-themes.org and may be regenerated, which would drop anything added to them. Move the SVG example that exercises SVG-to-PDF conversion into the theme's own docs: a new examples/images page, with the asset in docs/_static (matching the videos example). Restores docs/kitchen-sink/images.rst to its pristine vendored form. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The previous commit wired package.json's build to run this script but never committed the file itself, so CI failed with MODULE_NOT_FOUND. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
Hi @robredpath - this PDF formatting looks great! No comments or obvious things odd about the Sphinx site example you've shared. There may be minor formatting things to log when we apply this to our other docs sites, but no reason not to move forward with it. (Consider this 'reviewed' from my perspective) |
No description provided.