summaryrefslogtreecommitdiff
path: root/sphinx/builders
Commit message (Collapse)AuthorAgeFilesLines
* html builder: Append CRC32 checksum to asset URIs (#11415)Adam Turner2023-05-114-13/+49
|
* Warn on deprecated Python-specific index types (#11412)Adam Turner2023-05-091-5/+0
|
* linkcheck: Use context managers for HTTP requests (#11318)James Addison2023-05-091-12/+10
| | | | | | | | This closes HTTP responses when no content reads are required, as when requests are made in streaming mode, ``requests`` doesn't know whether the caller may intend to later read content from a streamed HTTP response object and holds the socket open. Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
* Remove HTML 4 support (#11385)Adam Turner2023-04-281-13/+9
|
* Remove ``HTMLTranslator`` and ``html5_ready`` from ``sphinx.builders.html`` ↵Adam Turner2023-04-281-18/+0
| | | | (#11383)
* Remove deprecated ``style`` key for HTML templates (#11381)Adam Turner2023-04-281-1/+0
|
* Make the ``env`` argument to ``Builder`` subclasses required (#11379)Adam Turner2023-04-281-21/+4
|
* Revert "Support and prefer ``.jinja`` to ``_t`` for static templates ↵James Addison2023-04-235-11/+10
| | | | | (#11165)" (#11329) This reverts commit 5d13215b58f93c6be8255ef2e3e20836508c7d47.
* Partially revert "Disable localisation when SOURCE_DATE_EPOCH is set ↵Adam Turner2023-04-212-2/+2
| | | | | (#10949)" (#11343) This keeps some of the added tests, and avoids a full revert of ``sphinx.locale``.
* Support and prefer ``.jinja`` to ``_t`` for static templates (#11165)James Addison2023-04-075-10/+11
| | | Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
* Disable localisation when ``SOURCE_DATE_EPOCH`` is set (#10949)James Addison2023-04-072-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit disables Sphinx's localisation features when reproducible builds are requested, as determined by a non-empty SOURCE_DATE_EPOCH_ environment variable. The `Reproducible Builds`_ project aims to provide confidence to consumers of packaged software that the artefacts they're downloading and installing have not been altered by the environment they were built in, and can be replicated at a later date if required. Builds of localised documentation using Sphinx currently account for a large category of reproducible build testing failures, because the builders intentionally use varying environment locales at build-time. This can affect the contents of the ``objects.inv`` file. During investigation, it turned out that many ``gettext``-localised values (particularly in Python modules under ``sphinx.domains``) were being translated at module-load-time and would not subsequently be re-localised. This creates two unusual effects: 1. Attempting to write a test case to build the same application in two different languages was not initially possible, as the first-loaded translation catalogue (as found in the ``sphinx.locale.translators`` global variable) would remain in-use for subsequent application builds under different locales. 2. Localisation of strings could vary depending on whether the relevant modules were loaded before or after the resource catalogues were populated. We fix this by performing all translations lazily so that module imports can occur in any order and localisation of inventory entries should occur only when translations of those items are requested. Localisation can then be disabled by configuring the ``gettext`` language to the ISO-639-3 'undetermined' code (``'und'``), as this should not have an associated translation catalogue. We also want to prevent ``gettext`` from attempting to determine the host's locale from environment variables (including ``LANGUAGE``). .. _SOURCE_DATE_EPOCH: https://reproducible-builds.org/docs/source-date-epoch/ .. _Reproducible Builds: https://www.reproducible-builds.org/
* Ensure arguments to ``PIL.Image.resize()`` are integers (#11288)James Reinders2023-04-061-1/+1
| | | | | | | Update ``copy_image_files_pil`` so that the computation of ``nh`` is always an integer, as otherwise some calls to ``PIL.Image.resize()`` fail as floats are not allowed Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
* Enable 'nit-picky mode' for Sphinx's documentationAdam Turner2023-04-061-2/+3
| | | | | Fix several reference errors throughout the documentation and set ``nitpick_ignore`` in ``doc/conf.py``.
* Only use ``_write_doc_doctree_cache`` in serial mode (#11290)Martin Liška2023-04-051-5/+11
| | | | | | | When using multiple processes, the content of ``self.env._write_doc_doctree_cache`` is not synchronised with the main process, meaning we can only use it in serial mode. Co-authored-by: Adam Turner <9087854+aa-turner@users.noreply.github.com>
* Fix error message wording in builders/latex/transforms.pyJean-François B2023-04-011-3/+5
| | | | | And make it and the two other ones there translatable strings. Using .format for the f-string.
* Fix typos found by codespellDimitri Papadopoulos2023-03-271-1/+1
|
* Speed up ``test_linkcheck``Adam Turner2023-03-241-1/+1
|
* Add missing quotes in html 4 deprecation textRafael Fontenelle2023-03-211-1/+1
|
* Remove useless compatability importsAdam Turner2023-03-171-7/+0
| | | | | | This exposed names at ``sphinx.builders.html.sphinxcontrib.serializinghtml``, etc, which offers no benefit. This was originally broken in commit 9dfbfbf16b9873de3ff94984e40b5bc41e28005e, four years ago.
* Remove deprecated code in ``sphinx.builders.linkcheck`` (#11089)danieleades2023-03-171-8/+4
| | | Co-authored-by: daniel.eades <daniel.eades@hotmail.com>
* Drop OrderedDictAdam Turner2023-03-051-3/+3
| | | | Since Python 3.7, dicts maintain insertion order.
* Resolve ``flake8-return`` errorsAdam Turner2023-02-183-7/+4
|
* Unescape quotation marks where possibleAdam Turner2023-02-181-1/+1
|
* Fix COM812Adam Turner2023-02-189-23/+23
|
* Restore correct parallel search index building (#11192)Jeremy Maitin-Shepard2023-02-151-4/+3
| | | | | | | | | | | | Revert b32841e153431ec02de31e9ec32e79ab3ac7d1c2 to fix parallel search index building The image-related changes were already reverted in 2a7c40d07f4b0e0fd2a4bc942e74634c2df24dee, but the search index changes also need to be reverted. It would be nice to support parallel search index building, but the necessary support for merging the search indices produced by each process needs to be added first.
* Resolve Ruff SIM114 violationsAdam Turner2023-02-152-8/+7
|
* Define ``sphinx.builders.gettext.LocalTimeZone.tzname()``Adam Turner2023-02-111-0/+3
|
* Collapse ``.startswith`` and ``.endswith`` testsAdam Turner2023-02-091-4/+2
|
* Merge branch '6.1.x'Adam Turner2023-01-105-32/+25
|\ | | | | | | | | | | # Conflicts: # CHANGES # sphinx/__init__.py
| * Handle exceptions for ``get_node_source`` and ``get_node_line``Adam Turner2023-01-101-1/+4
| |
| * Undo parallel image changesAdam Turner2023-01-104-31/+21
| |
* | Replace deprecation tooling with module level ``__getattr__`` (#11054)Adam Turner2023-01-081-11/+18
| |
* | Adopt ``profile = "black"`` for ``isort``Adam Turner2023-01-071-2/+7
|/ | | | This allows using Ruff's import sorting fixers
* Fix copying images under parallel execution (#11100)Adam Turner2023-01-074-16/+28
|
* Cache doctrees between reading and writing phasesAdam Turner2023-01-041-0/+2
|
* Move XML Name pattern to ``epub3``Adam Turner2023-01-031-2/+16
|
* Move console output utilities to ``sphinx.util.display``Adam Turner2023-01-038-9/+16
| | | | | - Merge `old_status_iterator` into ``status_iterator``. ``old_status_iterator`` was deprecated in version 1.6.
* Move tasks into parallel writingAdam Turner2023-01-021-9/+8
|
* Address SIM103 lints (#11052)danieleades2023-01-021-4/+1
| | | Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
* Use ``any`` to find elements in iterable (#11053)danieleades2023-01-021-5/+5
|
* Run pyupgrade (#11070)Adam Turner2023-01-028-36/+34
|
* Use PEP 604 typesAdam Turner2023-01-0116-53/+50
|
* Use PEP 595 typesAdam Turner2023-01-0119-168/+166
|
* Insert ``from __future__ import annotations``Adam Turner2023-01-0120-0/+40
|
* Fix ``SIM904``, directly construct dicts (#11059)danieleades2023-01-011-5/+5
|
* Factor out HTML 4 translator (#11051)Adam Turner2022-12-301-3/+8
| | | Move the HTML 4 translator into a private module.
* Fix lookup table for multi-word key names (``kbd`` role) (#10962)textshell2022-12-301-4/+4
| | | | | It seems the original PR adding multi word key support forgot to add commas and python helpfully just concatenated the strings instead of building the required tuples.
* Adopt the Ruff code linting toolAdam Turner2022-12-291-1/+1
| | | | https://github.com/charliermarsh/ruff
* remove blanket 'noqas'Daniel Eades2022-12-166-15/+34
|
* Update typing ignores for mypy 0.990Adam Turner2022-11-131-1/+1
|