Commit Graph

269 Commits

Author SHA1 Message Date
Adam Turner
217f267822
Do not overwrite user-supplied data by default when copying (#12647) 2024-07-22 16:00:16 +01:00
Chris Sewell
dabacdf5f8
Turn `show_warning_types` on by default (#12597)
Co-authored-by: Adam Turner <9087854+aa-turner@users.noreply.github.com>
2024-07-20 21:07:06 +01:00
James Addison
cc08854bc2
linkcheck: Update configuration defaults for Sphinx 8.0 (#12630)
- Links that respond with HTTP 401 (unauthorized) responses are now considered ``broken`` by default.
- Timeouts that occur when checking a link are now reported with a distinct `timeout` status code, instead of the previous ``broken``.
- The previous behaviours are still available and can be configured on an opt-in basis per-project using ``conf.py``.

Co-authored-by: Adam Turner <9087854+aa-turner@users.noreply.github.com>
2024-07-20 20:41:22 +01:00
Adam Turner
0f38c9c15d Emend various spelling errors 2024-07-15 02:16:34 +01:00
Adam Turner
1252c7b549 Use "rst" consistently for code and highlighting directives 2024-07-15 02:15:52 +01:00
Adam Turner
3b19a7b4ba Add missing `docutils` warning type in the documentation 2024-07-13 07:16:58 +01:00
Trevor Bekolay
2c0943784c
Disallow module cycles in autosummary (#6792)
Consider the following piece of reST::

  .. automodule:: sphinx.ext.autosummary
     :members:

     .. autosummary::

        sphinx.ext.autosummary.Autosummary

This inserts an autosummary after the module docstring, but before
the members of the module. Without the change in this commit, this
would fail because `import_by_name` would attempt to import::

    sphinx.ext.autosummary.sphinx.ext.autosummary.Autosumary

because the prefix (from the parent) is `sphinx.ext.autosummary`,
and the name is `sphinx.ext.autosummary.Autosummary`, which is able
to be imported from `sphinx.ext.autosummary`, but is not the way
that anyone would want to refer to it.

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2024-07-13 06:37:50 +01:00
Rafael Fontenelle
9234d0b08d
Add missing backtick to close literal role in configuration.rst (#12547) 2024-07-11 21:29:52 +01:00
Thomas Fanning
6cc1177d10
Allow configuring the separator used in numbering equations (#12523)
Co-authored-by: Thomas Fanning <tom@ferb.ne.anl.gov>
Co-authored-by: Adam Turner <9087854+aa-turner@users.noreply.github.com>
2024-07-10 22:23:38 +01:00
Adam Turner
82edc3d385
Rewrite `usage/configuration.rst` (#12537)
- Remove now-removed configuration values
- Use obvious 'unset' defaults for ``project`` and ``author``
- Prefer 'e.g.' to 'ex.'
- Allow non-list sequence types in various configuration values
- Add types and defaults to every confval directive
2024-07-10 21:43:14 +01:00
Adam Turner
d2f1acc0ca
Simplify `Tags` (#12490)
- Use a set to store the list of tags
- Cache evaluated expressions
- Extract locally-defined function into a private method
2024-06-29 10:21:23 +01:00
Ondřej Navrátil
3b3a7d911b
[toctree] Adding warning type/subtype toc.no_title (#12479)
Add warning type and subtype to warning generated in toctree
2024-06-27 23:34:46 +02:00
James Addison
6b237d9a70
[linkcheck] Allow integer for linkcheck_rate_limit_timeout (#12470)
Eliminate type-related warnings when users configure a valid integer value for the `linkcheck_rate_limit_timeout` config setting.

Co-authored-by: Chris Sewell <chrisj_sewell@hotmail.com>
2024-06-24 17:26:24 +00:00
Adam Turner
af271881e2 Add `config.cache` to the list of warning types 2024-04-17 21:23:01 +01:00
James Addison
532ad0306e
linkcheck: Make the new 'timeout' status opt-in (#12023)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2024-04-12 23:18:22 +01:00
Nok Lam Chan
17a84a6443
[doc] clarify units for `linkcheck_rate_limit_timeout` (#12225)
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>

This normalizes the description of the configuration value so that its default value's unit is the same as the internal one (i.e., seconds).
2024-04-05 11:51:02 +02:00
Chris Sewell
b0f096f440
Add show_warning_types configuration variable (#12131)
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2024-03-19 10:22:28 +01:00
Bénédikt Tran
b2069fb64f
[lint] update Makefile and lint doc (#12117) 2024-03-17 14:45:56 +01:00
Alexandre Franke
1281b158b4
Fix typos in usage/configuration.rst (#12024) 2024-03-07 20:50:46 +01:00
Adam Turner
587e01177d Provide example interface for ``Scorer` 2024-01-14 04:47:44 +00:00
Adam Turner
23cef9b59a Use `https://` where possible 2024-01-14 04:18:57 +00:00
James Addison
2b47fd4b4b
Update linkcheck_timeout value and documentation (#11875) 2024-01-13 17:41:28 +00:00
Alex Szatmary
bcb1825679
State that `exclude_patterns` has priority (#11872) 2024-01-12 04:28:47 +00:00
James Addison
5211c01646
Enable reporting HTTP 401 hyperlinks as broken in linkcheck (#11684)
Co-authored-by: picnixz <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2024-01-09 12:33:40 +00:00
Adam Turner
c0e17eca40 Move the domains reference up one level 2023-10-02 13:09:38 +01:00
Adam Turner
7e9a2066c2 Be more ephemeral (in anchor link title text) 2023-08-12 05:30:38 +01:00
Adam Turner
066e0fabc6
Add translation progress information (#11509)
Co-authored-by: Manuel Kaufmann <humitos@gmail.com>
2023-07-24 20:19:31 +01:00
picnixz
82bc15aec3
Enable skipping anchor verification on a per-URL basis (#11489)
Add a new ``linkcheck_anchors_ignore_for_url`` configuration variable.

Co-authored-by: Adam Turner <9087854+aa-turner@users.noreply.github.com>
2023-07-24 12:15:42 +01:00
picnixz
480630c649
Support PEP 695 and PEP 696 syntax in the Python domain (#11444)
* Generic classes can be documented with ``.. py:class::`` using PEP 695 syntax:

  .. code:: rst

     .. py:class:: Sequence[T]

* Generic functions can be documented with ``.. py:function::`` using PEP 695 syntax:

  .. code:: rst

     .. py:function:: foo[T](x: T)

* Default values for type bounds are supported.

Co-authored-by: Adam Turner <9087854+aa-turner@users.noreply.github.com>
2023-07-23 23:22:40 +01:00
Stefanie Molin
e09d02e440
Allow `copyright` to contain multiple entries (#10983)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2023-05-11 22:43:48 +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
Adam Turner
706f5f9cc8
Warn on deprecated Python-specific index types (#11412) 2023-05-09 22:57:39 +01:00
Adam Turner
7ecf037280 Enable 'nit-picky mode' for Sphinx's documentation
Fix several reference errors throughout the documentation and set
``nitpick_ignore`` in ``doc/conf.py``.
2023-04-06 23:11:39 +01:00
Adam Turner
4a3febb69a
Add an option for displaying short `Literal` types (#11109)
The new ``python_display_short_literal_types`` configuration option
for the ``py`` domain controls display of PEP 586 ``Literal`` types.
The 'short' format is inspired by PEP 604, using the bitwise OR operator
to distinguish the possible legal values for the argument.
2023-04-05 13:07:25 +01:00
Mike Taves
23bf041ce4
Remove unicode prefix (`u`) from strings (#11158) 2023-02-15 04:37:33 +00:00
Jean-François B
ddf4daf2c6
Doc of html_file_suffix (closes #11141) (#11144) 2023-01-22 19:32:12 +01:00
Harrissou Sant-anna
da6a20d50b
Fix typos in usage/configuration.rst (#10834) 2023-01-02 04:48:53 +00:00
Jean-François B
b1ca6b3e12
Fix #10984 [DOC] document latex_additional_files behavior with .tex (#10993) 2022-11-30 18:52:48 +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
Adam Turner
592b46c431
Revert `html_codeblock_linenos_style` removal (#10922) 2022-10-16 16:50:53 +01:00
Adam Turner
e70a0fac6d Merge branch '5.x'
# Conflicts:
#	.github/workflows/main.yml
#	CHANGES
#	sphinx/__init__.py
#	sphinx/domains/c.py
2022-10-16 11:24:18 +01:00
Jean-François B
b5ba1ede2a s/5.2.0/5.3.0 in various code comments as #10759 got merged in 5.3.0 2022-10-12 17:41:39 +02: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
Adam Turner
63dea6172a Merge branch '5.x'
# Conflicts:
#	sphinx/locale/__init__.py
2022-09-30 16:15:24 +01:00
Adam Turner
650f63b9f7
Finer grained control over domain ToC entries (#10886)
- Implement `:nocontentsentry:` flag
- Use `:nocontentsentry:` in docs
- Add domain object table of contents configuration option
2022-09-30 10:31:58 +01:00
Adam Turner
56aa3412ef Merge branch '5.x'
# Conflicts:
#	setup.py
#	sphinx/__init__.py
2022-09-23 17:27:00 +01:00
Adam Turner
f57177de89
Add contents entries for domain objects (#10807)
- Add entries in the table of contents for domain objects (e.g. 
  `py:function`, `rst:role`, etc). Supported domains are Javascript,
  Python, and reStructuredText.
- Support content in `py:module` and `js:module` directives.
- Add the `noindexentry` and `noindex` flags to more domains.
- Add `toc_object_entries_show_parents` configuration setting
- Update documentation and tests
2022-09-13 20:20:02 +01:00
Adam Turner
ee005caf22 Do not apply epigraph style to all block quotes
Correct indentation where appropriate for stanzas that should not be
rendered as `<blockquote>` HTML elements.

Closes GH-10686
2022-09-12 19:54:36 +01:00
Adam Turner
19b54dce6a Merge branch '5.x'
# Conflicts:
#	CHANGES
#	sphinx/__init__.py
2022-07-24 14:15:26 +01:00
Adam Turner
e3337c78c6
Update include_patterns implementation (#10680) 2022-07-23 21:19:35 +01:00