summaryrefslogtreecommitdiff
path: root/sphinx/writers
Commit message (Collapse)AuthorAgeFilesLines
* Allow multi-line object description signatures (#11011)TLouf2023-05-113-21/+218
| | | | | Co-authored-by: Adam Turner <9087854+aa-turner@users.noreply.github.com> Co-authored-by: Jean-François B <2589111+jfbu@users.noreply.github.com> Co-authored-by: TLouf <loufthomas@gmail.com>
* Remove HTML 4 support (#11385)Adam Turner2023-04-282-861/+3
|
* Remove deprecated ``LaTeXTranslator.docclasses`` attribute (#11382)Adam Turner2023-04-281-9/+0
|
* Revert "Support and prefer ``.jinja`` to ``_t`` for static templates ↵James Addison2023-04-231-18/+10
| | | | | (#11165)" (#11329) This reverts commit 5d13215b58f93c6be8255ef2e3e20836508c7d47.
* Partially revert "Disable localisation when SOURCE_DATE_EPOCH is set ↵Adam Turner2023-04-213-4/+4
| | | | | (#10949)" (#11343) This keeps some of the added tests, and avoids a full revert of ``sphinx.locale``.
* Update CHANGES for PR #11333Bénédikt Tran2023-04-181-3/+3
|
* Fix duplicated labels in TeX output (#11093)Bénédikt Tran2023-04-171-1/+20
|
* Support and prefer ``.jinja`` to ``_t`` for static templates (#11165)James Addison2023-04-071-10/+18
| | | Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
* Disable localisation when ``SOURCE_DATE_EPOCH`` is set (#10949)James Addison2023-04-073-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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/
* Resolve lint errors from Ruff 0.0.261Adam Turner2023-04-051-2/+1
|
* Resolve lint errors from Ruff 0.0.260Adam Turner2023-03-311-1/+2
|
* LaTeX: let mark-up for seealso directive use explicit colon (fix #11264)Jean-François B2023-03-261-1/+1
|
* Resolve ``flake8-return`` errorsAdam Turner2023-02-183-45/+41
|
* Fix pytest style issuesAdam Turner2023-02-183-3/+3
|
* Fix COM812Adam Turner2023-02-185-10/+10
|
* Resolve Ruff SIM114 violationsAdam Turner2023-02-154-12/+10
|
* Collapse ``.startswith`` and ``.endswith`` testsAdam Turner2023-02-091-2/+1
|
* LaTeX: ``\emph`` replaced by ``\sphinxparam`` and ``\sphinxsamedocref``Jean-François B2023-01-241-2/+2
|
* Remove unneeded typing importsAdam Turner2023-01-231-5/+2
|
* Sort imports with Ruff's conventionAdam Turner2023-01-231-2/+4
|
* Merge branch '6.1.x'Adam Turner2023-01-102-6/+6
|\ | | | | | | | | | | # Conflicts: # CHANGES # sphinx/__init__.py
| * Undo parallel image changesAdam Turner2023-01-102-6/+6
| |
* | Fix #11079 (LaTeX: figure with align disappears if not followed by text)Jean-François B2023-01-081-1/+4
|/
* Fix #6744: support for seealso directive should be via an environmentJean-François B2023-01-031-2/+3
|
* Make MyPy happyAdam Turner2023-01-022-6/+6
|
* Shrink 'any-generics' whitelist for 'writers' module (#10867)danieleades2023-01-023-8/+11
| | | Co-authored-by: Adam Turner <9087854+aa-turner@users.noreply.github.com>
* Run pyupgrade (#11070)Adam Turner2023-01-026-59/+57
|
* Use PEP 604 typesAdam Turner2023-01-015-26/+26
|
* Use PEP 595 typesAdam Turner2023-01-016-83/+81
|
* Insert ``from __future__ import annotations``Adam Turner2023-01-018-0/+16
|
* Factor out HTML 4 translator (#11051)Adam Turner2022-12-302-846/+861
| | | Move the HTML 4 translator into a private module.
* Enable Ruff's pylint 'PLC2201' checkAdam Turner2022-12-301-1/+1
| | | | Address all cases where the comparison order check is violated
* Allow line breaks before binary operatorsAdam Turner2022-12-291-2/+2
|
* remove blanket 'noqas'Daniel Eades2022-12-164-6/+12
|
* Deactivate (provisorily) Python12-dev testing (#11035)Jean-François B2022-12-161-1/+2
| | | | | | | | | | | | | * fix flake8 warnings * Deactivate (provisorily) testing with 3.12-dev (refs: https://github.com/sphinx-doc/sphinx/pull/10995#issuecomment-1330310586 ) * Escape # in tox.ini for tox 4 compatibility ('du-latest' tests) Co-authored-by: Daniel Eades <danieleades@hotmail.com>
* Update typing ignores for mypy 0.990Adam Turner2022-11-132-4/+4
|
* Run the ``pyupgrade`` toolAdam Turner2022-10-171-5/+5
|
* Revert ``html_codeblock_linenos_style`` removal (#10922)Adam Turner2022-10-162-2/+8
|
* Merge branch '5.x'Adam Turner2022-10-163-28/+83
|\ | | | | | | | | | | | | | | # Conflicts: # .github/workflows/main.yml # CHANGES # sphinx/__init__.py # sphinx/domains/c.py
| * URI-escape image filenames (#10268)Eric Wieser2022-10-133-6/+9
| | | | | | | | | | | | | | | | Without this change, local images with `#` in their name result in incorrect URLs There is already a similar call to `urllib.parse.quote` for file downloads, suggesting this is a sensible approach. Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com> Co-authored-by: Takeshi KOMIYA <i.tkomiya@gmail.com>
| * LaTeX: support for booktabs-style and zebra-striped tables (#10759)Jean-François B2022-10-121-22/+74
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a combination of 2 + 28 + 7 + and some more commits... * Cherry-pick: Add support for booktabs-style tables to LaTeX builder * Cherry-pick: Add support for zebra-striped tables to LaTeX builder Co-authored-by: Stefan Wiehler <stefan.wiehler@missinglinkelectronics.com> Above work originally initiated by @sephalon (thanks!) Development refactored and continued by @jfbu * latex_table_style configuration, support booktabs, colorrows, borderless Some details: - Simplify a bit a conditional in the longtable template This also puts the target for a longtable with a label but no caption above the toprule for better hyperlinking (testing shows hyperlink target can not end up alone at bottom of previous page). - Extend allowed syntax for colour assignments via 'sphinxsetup' - latex_table_style new configuration value and coloured rows For the user interface I tried to look for inspiration in https://docutils.sourceforge.io/docs/user/config.html#table-style which mentions booktabs and borderless. They also mention captionbelow which we can implement later, now that architecture is here. They don't mention coloured rows. - Test on our own document... looks fine! - Work-around an incompatibility of \cline with row colours - Reverse priority of classes to allow overruling booktabs by standard after parsing source but before letting LaTeX writer act - Closes #8220 Commit https://github.com/sphinx-doc/sphinx/commit/bb859c669679baebd8cc8d10c99382478c0d1647 already improved a bit, this finishes it (as :rst:dir:`rst-class` was actually not linking to anywhere). - Let booktabs style defaults to *not* using \cmidrule. They actually don't make much sense there, as all \hline's are removed. - Add \sphinxnorowcolor which allows construct such as this one in a tabularcolumns directive: >{\columncolor{blue}\sphinxnorowcolor} else LaTeX always overrides column colour by row colour - Add TableMergeColorHeader, TableMergeColorOdd, TableMergeColorEven so single-row merged cells can be styled especially - Extend row colours to all header rows not only the first one (all header rows will share same colour settings) - Auto-adjust to a no '|'-colspec for optimal handling of merged cell - Add \sphinxcolorblend - Workaround LaTeX's \cline features and other grid tables matters - Add \sphinxbuildwarning for important warnings - Fix some white gaps in merged cells of tables with vlines and colorrows - Work around LaTeX's \cline serious deficiencies for complex grid tables This commit corrects \cline badly impacting vertical spacing and making tables look even more cramped as they usually are in LaTeX (although one sees it clearly only with \arrarrulewidth a bit more than the LaTeX default of 0.4pt). Most importantly this commit solves the problem that \cline's got masked by colour panels from the row below. - Update CHANGES for PR #10759 - Improve documentation of new latex_table_style regarding colours
* | Merge branch '5.x'Adam Turner2022-09-251-0/+1
|\ \ | |/ | | | | | | | | | | | | | | | | # Conflicts: # CHANGES # doc/conf.py # sphinx/__init__.py # sphinx/builders/html/__init__.py # sphinx/domains/python.py # tests/test_build_html.py
| * Deprecate HTML 4 support (#10843)Adam Turner2022-09-231-0/+1
| |
* | Merge branch '5.x'Adam Turner2022-09-233-5/+5
|\ \ | |/ | | | | | | | | # Conflicts: # setup.py # sphinx/__init__.py
| * Shrink strict optional whitelist (HTML writers) (#10838)danieleades2022-09-203-5/+5
| |
* | Merge branch '5.x'Adam Turner2022-09-092-19/+14
|\ \ | |/ | | | | | | | | | | | | | | # Conflicts: # setup.py # sphinx/application.py # sphinx/environment/__init__.py # sphinx/ext/autodoc/directive.py # tests/test_build_html.py
| * Remove Pygments compatability code (#10812)Adam Turner2022-09-091-9/+4
| |
| * Fix more strict static typing errors (#10681)danieleades2022-08-281-3/+3
| |
| * Remove unneeded `noqa` lint suppression comments (#10772)danieleades2022-08-281-1/+1
| |
| * Further improve type annotations, reduce mypy whitelist (#10770)danieleades2022-08-281-6/+6
| | | | | | Co-authored-by: Adam Turner <9087854+aa-turner@users.noreply.github.com>