gamemanual0 / gm0

Game Manual 0 - The most extensive guide out there for FTC
https://gm0.org
Other
53 stars 84 forks source link

Set default image width/alignment with a sphinx extension #404

Closed abidingabi closed 8 months ago

abidingabi commented 8 months ago

Previously, this value was set with css. This worked fine for the HTML build, but did nothing for the LaTeX build. This way, the default width applies to all build formats.

abidingabi commented 8 months ago

As an example of the PDF output that is produced, see https://github.com/abidingabi/gm0/suites/17542735304/artifacts/1002238368.

abidingabi commented 8 months ago

I spotted a bug: tags.has("html") in conf.py does not work because

Only tags set via the -t command-line option or via tags.add('tag') can be queried using tags.has('tag'). Note that the current builder tag is not available in conf.py, as it is created after the builder is initialized. — https://www.sphinx-doc.org/en/master/usage/configuration.html

abidingabi commented 8 months ago

PDF built from this branch: https://github.com/gamemanual0/gm0/suites/17544428062/artifacts/1002339029.

Before: image

After: image

abidingabi commented 8 months ago

Before the above change: image

After: image