From e929d15848da4d538f70a830f642a7bf913feaab Mon Sep 17 00:00:00 2001 From: Andrew Neitsch Date: Thu, 2 Sep 2021 17:40:41 -0600 Subject: [PATCH] Include figures in PDF docs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The PDF documentation on readthedocs was missing the figures in the fixtures reference chapter. This PR uses a Sphinx plugin that automatically converts the checked-in SVG files to the PDF input files that LaTeX requires. The SVG-to-PDF conversion is done by inkscape, which gave the best conversion among the tools I tried. However, it [does not yet understand][href-bug] that you can write a plain `href` instead of `xlink:href` in svg files, so I’ve had to edit the SVG files accordingly. [href-bug]: https://github.com/TeX-Live/luatex.git --- .readthedocs.yml | 4 ++++ doc/en/conf.py | 1 + .../example/fixtures/fixture_availability.svg | 10 +++++----- .../fixtures/fixture_availability_plugins.svg | 12 ++++++------ ..._fixtures_order_autouse_multiple_scopes.svg | 6 +++--- ...est_fixtures_order_autouse_temp_effects.svg | 6 +++--- .../fixtures/test_fixtures_order_scope.svg | 4 ++-- .../test_fixtures_request_different_scope.svg | 8 ++++---- doc/en/reference/fixtures.rst | 18 +++++++++--------- doc/en/requirements.txt | 1 + 10 files changed, 38 insertions(+), 32 deletions(-) diff --git a/.readthedocs.yml b/.readthedocs.yml index 0176c2640..10c21fd8f 100644 --- a/.readthedocs.yml +++ b/.readthedocs.yml @@ -7,6 +7,10 @@ python: - method: pip path: . +build: + apt_packages: + - inkscape + formats: - epub - pdf diff --git a/doc/en/conf.py b/doc/en/conf.py index ee71ffcae..35941080b 100644 --- a/doc/en/conf.py +++ b/doc/en/conf.py @@ -55,6 +55,7 @@ extensions = [ "sphinx.ext.viewcode", "sphinx_removed_in", "sphinxcontrib_trio", + "sphinxcontrib.inkscapeconverter", ] # Add any paths that contain templates here, relative to this directory. diff --git a/doc/en/example/fixtures/fixture_availability.svg b/doc/en/example/fixtures/fixture_availability.svg index 3ca28447c..066caac34 100644 --- a/doc/en/example/fixtures/fixture_availability.svg +++ b/doc/en/example/fixtures/fixture_availability.svg @@ -1,4 +1,4 @@ - +