Commit Graph

423 Commits

Author SHA1 Message Date
Adam Turner
e010e24728 Fix B904 (raise exceptions with `raise ... from ...`) 2023-08-13 22:11:15 +01:00
Adam Turner
0a42d91e7e Fix `test_{html,latex}_warnings` 2023-08-12 06:40:55 +01:00
Adam Turner
02e011e4ff Fix PT006 (use tuples in `pytest.mark.parametrize`) 2023-08-10 13:00:48 +01:00
Adam Turner
49d8304670
Start using `pathlib.Path and deprecate sphinx.testing.path` (#11526) 2023-07-28 00:39:12 +01:00
TLouf
86b07d4a97
Allow multi-line object description signatures (#11011)
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>
2023-05-11 14:28:57 +01:00
James Addison
59de8d5202
Revert "Support and prefer `.jinja to _t` for static templates (#11165)" (#11329)
This reverts commit 5d13215b58.
2023-04-23 19:06:44 +01:00
Bénédikt Tran
e2f66cea49 Update CHANGES for PR #11333 2023-04-18 12:13:20 +02:00
Bénédikt Tran
61576516d4 Fix duplicated labels in TeX output (#11093) 2023-04-17 12:07:32 +02:00
Martin Liska
b6e6805f80 test_build_latex: move output to a separate output dir
Related: #11285
Co-authored-by: Jean-François B <2589111+jfbu@users.noreply.github.com>
2023-04-13 06:15:50 +02:00
Jean-François B
509cc4533c LaTeX: get aligned longtable obey current list indent
Fix #11268.

Thanks to @picnixz.
2023-04-11 20:32:31 +02:00
James Addison
5d13215b58
Support and prefer `.jinja to _t` for static templates (#11165)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2023-04-07 18:07:15 +01:00
Jean-François B
8f6ad4a3e5 Fix #11274: external links may break PDF build if under \sphinxupquote 2023-03-31 18:19:35 +02:00
Jean-François B
a7949d4290 LaTeX: let mark-up for seealso directive use explicit colon (fix #11264) 2023-03-26 23:57:04 +02:00
Adam Turner
9df3b59e00 Resolve lint errors from Ruff 0.0.259 2023-03-23 21:58:49 +00:00
Jeremy Maitin-Shepard
7a4ce71f6b
Include source in highlighting warnings (#11150)
If pygments fails to lex a source string as the specified highlight
language, Sphinx prints a warning.  Previously, that warning did not
include the actual source text, although it does include location
information.

However, in some cases the location information may be missing, there
may be multiple highlighted literals on the same line, or the rST is
automatically generated somehow.  In such cases, it can be difficult
to determine the source text that led to the error.

With this change, the source text is included in the warning.
2023-03-17 15:32:27 +00:00
Adam Turner
f435fc05e6 Prefer `contextlib.chdir to sphinx.util.osutil.cd` 2023-03-05 18:49:17 +00:00
Adam Turner
6c56988979 Unescape quotation marks where possible 2023-02-18 02:16:50 +00:00
Adam Turner
13442f6901 Fix pytest style issues 2023-02-18 02:16:50 +00:00
Adam Turner
c8f4a03dac Fix COM812 2023-02-18 01:58:05 +00:00
Adam Turner
e17f39e7b5 Merge branch '6.1.x'
# Conflicts:
#	CHANGES
#	sphinx/__init__.py
2023-01-10 16:00:59 +00:00
Adam Turner
2a7c40d07f Undo parallel image changes 2023-01-10 14:53:17 +00:00
Jean-François B
19b0710944 Fix #11079 (LaTeX: figure with align disappears if not followed by text) 2023-01-08 19:40:24 +01:00
Adam Turner
a1cd19e601
Fix copying images under parallel execution (#11100) 2023-01-07 17:35:21 +00:00
Adam Turner
a9b0f2708b Cache doctrees more efficiently 2023-01-04 05:46:23 +00:00
Jean-François B
bfd95dadf2 Fix #6744: support for seealso directive should be via an environment 2023-01-03 18:58:39 +01:00
Adam Turner
4032070e81
Run pyupgrade (#11070) 2023-01-02 00:01:14 +00:00
Adam Turner
b91f6617ed Enable Ruff's pylint 'PLC2201' check
Address all cases where the comparison order check is violated
2022-12-30 00:06:11 +00:00
Adam Turner
920828fe35 Run the `pyupgrade` tool 2022-10-17 22:39:09 +01:00
Jean-François B
49c48f5aee
LaTeX: switch to some nicer defaults for tables and code-blocks (#10924) 2022-10-17 11:19:25 +02:00
Eric Wieser
fa6d42597f
URI-escape image filenames (#10268)
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>
2022-10-13 17:37:07 +01:00
Martin Liška
e008e16200
Revert "Fix detection for out of date files (#9360)" (#10908)
This reverts commit b1390c4191.

The change is reverted because some builders don't have
fine-grained support for outdated docs:
https://github.com/sphinx-doc/sphinx/issues/10903#issuecomment-1273199352
2022-10-13 13:16:17 +01:00
Jean-François B
e7c0881992
LaTeX: support for booktabs-style and zebra-striped tables (#10759)
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
  bb859c6696
  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
2022-10-12 17:15:40 +02:00
Martin Liška
b1390c4191
Fix detection for out of date files (#9360)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2022-10-05 14:44:41 +01:00
daniel.eades
964fcb2e07 Fix flake8 5.0.0 reported formatting errors 2022-08-01 20:55:47 +02:00
danieleades
25d379fb53
Lint with flake8-bugbear (#10602)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2022-07-12 22:55:57 +01:00
Ezio Melotti
1a1491b8a7
Show the repr of the value in some warnings (#10439)
Co-authored-by: Adam Turner <9087854+aa-turner@users.noreply.github.com>
2022-06-16 21:07:25 +01:00
jfbu
97f4a036d1 Fix #10434: extra whitespace in pdf output for highlighted inline code
Related: #10251
2022-05-08 11:32:37 +02:00
Takeshi KOMIYA
425a3e6c09 Merge branch '4.x' into 5.x 2022-05-06 03:32:43 +09:00
Takeshi KOMIYA
3805e0646f
Merge pull request #10251 from jbms/fix-inline-syntax-highlight
Make code role highlighting consistent with code-block directive
2022-05-06 02:54:42 +09:00
Adam Turner
24e3b7c8c8 .read_text() -> .read_text(encoding='utf8') 2022-04-27 03:04:19 +01:00
jfbu
184f98ae95 LaTeX: correct footnote marks, extended with page of link target
Fix #10188

Footnotes in some LaTeX environments (tables, fulllineitems for object
descriptions) are gathered and appear after the environment, causing the
footnote to possibly appear on a page later than some of the footnote
marks referring it.

With this commit, the footnote mark compares page numbers and
incorporates the destination page number if it turns out to be distinct
from the page where it stands.
2022-04-16 19:33:18 +02:00
Jeremy Maitin-Shepard
099b54cb87 Make code role highlighting consistent with code-block directive
Fixes https://github.com/sphinx-doc/sphinx/issues/5157

This is factored out of the sphinx-immaterial theme:
1ef121a612/sphinx_immaterial/inlinesyntaxhighlight.py (L1)

See also:
https://github.com/sphinx-doc/sphinx/pull/6916
2022-03-19 20:37:49 -07:00
Takeshi KOMIYA
aa1bc83c2a Merge branch '4.x' 2022-03-19 22:58:15 +09:00
Takeshi KOMIYA
f7a0107ddb Merge branch '4.x' 2022-03-03 02:28:07 +09:00
Adam Turner
5775912455 Collapse single line docstrings 2022-02-20 03:13:45 +00:00
Adam Turner
6bb7b891a1 Remove copyright and licence fields 2022-02-20 03:06:23 +00:00
Adam Turner
5694e0ce60 Fix module docstring indentation 2022-02-20 00:35:13 +00:00
Adam Turner
4f5a3269a6 Fix module docstring first line 2022-02-20 00:11:08 +00:00
Adam Turner
6b8bccec59 Remove module titles in docstrings 2022-02-19 23:17:29 +00:00
Takeshi KOMIYA
f72cd83e4d Merge branch '4.x' 2022-02-19 16:08:05 +09:00