Commit Graph

588 Commits

Author SHA1 Message Date
Adam Turner
bffb54734f Note correct deprecation version for `sphinx.util.osutil.cd` 2023-04-23 20:45:25 +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
f5c957597d Normalise spelling of Sphinx versions 2023-03-24 00:44:33 +00:00
Adam Turner
f435fc05e6 Prefer `contextlib.chdir to sphinx.util.osutil.cd` 2023-03-05 18:49:17 +00:00
Adam Turner
670bcb743b
Documentation reshuffle (#11112) 2023-01-08 13:52:36 +00:00
Adam Turner
a2176d47b5 Fix deprecation warnings 2023-01-05 12:17:54 +00:00
Adam Turner
5eb79c126a Move exception formatting utilities to `sphinx.util.exceptions` 2023-01-03 22:09:30 +00:00
Adam Turner
3b3ce9cf7b Move HTTP-date formatting utils to utils.http_date 2023-01-03 19:02:38 +00:00
Adam Turner
8c5e7013ea Move console output utilities to `sphinx.util.display`
- Merge `old_status_iterator` into ``status_iterator``.
  ``old_status_iterator`` was deprecated in version 1.6.
2023-01-03 18:37:20 +00:00
Adam Turner
77a02cf696
Use PEP 604 display for `typing.Optional and typing.Union` (#11072) 2023-01-02 17:49:18 +00:00
Viktor Haag
5715abf1d4
Update removal note for logo and favicon variables (#11063)
These were removed in Sphinx 6.0.0
2022-12-31 17:38:06 +00: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
58a4449707
Deprecate HTML 4 support (#10843) 2022-09-23 18:12:54 +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
490a8a9162
Add include_patterns as the opposite of exclude_patterns (#10518) 2022-07-17 21:44:33 +01:00
Antony Lee
03c1e1b15c
Replace napoleon.iterators by simpler stack implementation (#9856) 2022-06-26 12:40:42 +01:00
Adam Turner
881f66c557
Simplify Sphinx's Stemmer (#10467) 2022-06-16 19:47:09 +01:00
Julien Palard
956cddb7d4
Replace doclinter with sphinx-lint (#10389)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2022-06-16 19:32:09 +01:00
Takeshi KOMIYA
f9dce5764e Mark sphinx.io:read_doc() deprecated 2022-05-08 02:15:58 +09:00
Takeshi KOMIYA
be212d98df Remove sphinx.util.docutils.__version_info__ on 7.0 2022-05-03 02:07:47 +09:00
Takeshi KOMIYA
3aa7e4105a Deprecate: html5_ready and is_html5_writer_available() 2022-05-03 01:48:17 +09:00
Adam Turner
3f8bf7acb1 Schedule removal for 7.0 2022-04-30 19:10:27 +01:00
Adam Turner
b536ffabc1 Deprecate sphinx.util.jsdump 2022-04-27 02:59:50 +01:00
Takayuki SHIMIZUKAWA
068f802df9
fix typo
from https://github.com/sphinx-doc/sphinx-doc-translations/pull/13
2022-04-19 04:10:39 +09:00
Takeshi KOMIYA
2db180da70 Merge branch '4.x' 2022-03-27 19:47:11 +09:00
Takeshi KOMIYA
e530c00b82 doc: Update docs for sphinx.parsers.Parser 2022-03-27 19:27:53 +09:00
Takeshi KOMIYA
f72cd83e4d Merge branch '4.x' 2022-02-19 16:08:05 +09:00
Takeshi KOMIYA
8b23f6db12 Merge commit '07110b7557a552ecfe702bdd6a2d2f9685cb1af9' 2022-02-14 03:03:40 +09:00
Takeshi KOMIYA
8224f6f44a Fix #10181: napoleon_use_ivar adds unexpected prefix to vars
Since 4.0, :ivar: items has not been rendered as hyperlinks.  So any
modules, classes and tilda are now harmful.  This removes the prefixing
filter for napoleon_use_ivar option.

refs: #5129 and #5977
2022-02-12 00:50:56 +09:00
Hinrich Mahler
84a6270685 Mention nitpick_ignore(_regex) in docs of warn-missing-reference 2022-01-18 22:01:52 +01:00
Takeshi KOMIYA
e4e58a4f27 Close #10062: Change the default language to 'en'
Change the default language to `'en'` if any language is not set in
`conf.py`.
2022-01-12 02:45:52 +09:00
Takeshi KOMIYA
0663602bb9 Close #9595: Deprecate setuptools integration 2022-01-01 20:19:27 +09:00
Takeshi KOMIYA
26cd8f100c Deprecate sphinx.writers.latex.LaTeXWriter.docclasses 2021-12-18 02:24:03 +09:00
Takeshi KOMIYA
b778ee806e Fix #9752: autodoc: Failed to detect type annotation for slots attribute 2021-10-23 14:59:36 +09:00
Takeshi KOMIYA
dd2ff3e911 Fix #9710: html: Wrong styles for even/odd rows in nested tables 2021-10-09 16:35:31 +09:00
Takeshi KOMIYA
0424da31ab
Merge branch '4.x' into 9683_add_css_file 2021-10-09 13:58:10 +09:00
Jakob Lykke Andersen
1fe87938e2 js nodes, docs, add entry in deprecation/removal table 2021-10-03 10:18:51 +02:00
Takeshi KOMIYA
1fbca49970 Close #9683: Revert the removal of `add_stylesheet()` API
It will be kept until the Sphinx-6.0 release.

Note: Now it emits a warning instead of DeprecationWarning to let the
users know the deprecation.
2021-10-03 16:34:57 +09:00
Takeshi KOMIYA
c0333d4464
Merge pull request #9666 from tk0miya/9662_docs_for_ObjectDescription
Add doc for ObjectDescription (refs: #9662)
2021-09-27 01:57:36 +09:00
Takeshi KOMIYA
9543962da6 Add doc for ObjectDescription (refs: #9662) 2021-09-23 12:56:09 +09:00
Takeshi KOMIYA
29ac4c1982 Fix #9637: Add Builder.allow_parallel to the list of builder APIs 2021-09-18 01:26:12 +09:00
Eisuke Kawashima
652ebf1bf5
Fix typo 2021-07-08 08:16:22 +09:00
Takeshi KOMIYA
ec351bdf3d Merge branch '4.0.x' into 4.x 2021-06-30 21:24:06 +09:00
Takeshi KOMIYA
62f128700e Fix #9032: docs: sphinx.environment.NoUri was removed at v3.0.0
Our deprecation list describes `sphinx.environment.NoUri` was removed at
v4.0.0.  But, acutally, it was removed at v3.0.0 (#6223).
2021-06-14 02:18:01 +09:00
Takeshi KOMIYA
519cc078fd Revert the removal of sphinx.util:force_decode()
After the release of 4.0.0, some 3rd party extensions have became not
working with the latest Sphinx because `force_decode()` function was
removed.  It was deprecated since Sphinx-2.0 and warned for the removal
since 3.0.

This reverts the removal and extends its deprecation period to 5.0.0.  I
hope it helps users of these extensions.
2021-06-13 16:31:33 +09:00
Takeshi KOMIYA
b6245266ab
Merge pull request #9303 from tk0miya/fix_docslint
doc: Fix docslint misunderstanding scope of code-blocks
2021-06-06 13:33:17 +09:00
Takeshi KOMIYA
e0500f7354 doc: Fix docslint misunderstanding scope of code-blocks 2021-06-06 13:24:06 +09:00
Takeshi KOMIYA
1418e3acbb
Merge pull request #9260 from tk0miya/9016_linkcheck_github_anchors
Close #9016: linkcheck builder failed to check the anchors of github.com
2021-06-04 01:18:22 +09:00
Takeshi KOMIYA
92335bd6e6 Close #9016: linkcheck builder failed to check the anchors of github.com 2021-06-01 00:31:15 +09:00
Takeshi KOMIYA
46c2e45aa6 deprecate sphinx.ext.autosummary._app 2021-05-31 02:09:10 +09:00
Takeshi KOMIYA
abe5ab4fa7
Merge pull request #9242 from tk0miya/refactor_env2
refactor: Make the app argument for BuildEnvironment required
2021-05-22 02:22:42 +09:00
Takeshi KOMIYA
63fbfb02f1 refactor: Make the app argument for BuildEnvironment required
At present, some attributes of env object are considered as optional
because they have been initialized by None on the constructor.  But
they have always been fullfilled actually.

To be clear the type hints of the env object, this makes the `app`
argument for the BuildEnvironment class required.  It can ensure the
attributes of env object are not optional.
2021-05-22 02:09:49 +09:00
igo95862
7554ad9593
doc: Upgraded babel.pocoo.org links to HTTPS 2021-05-16 16:37:51 +03:00
igo95862
e67c9e5df1
doc: Upgrade docutils.sourceforge.io links to HTTPS
Also change any docutils.sourceforge.net link to io
top level domain.
2021-05-16 15:53:49 +03:00
Takeshi KOMIYA
5078069eb1 Deprecate app.html_themes
The register is much better to store the HTML themes instead of the
application object.  So this migrates it to the registry object.
2021-05-12 01:36:14 +09:00
Dmitry Shachnev
356f7c53e2 Fix typos in doc/extdev/deprecated.rst 2021-05-09 20:14:38 +03:00
Takeshi KOMIYA
469def56b6 Fix #8597: autodoc: metadata only docstring is treated as undocumented
The metadata in docstring is invisible content. Therefore docstring
having only metadata should be treated as undocumented.
2021-05-02 23:17:58 +09:00
Takeshi KOMIYA
8ec937d4c9
Merge pull request #9050 from tk0miya/8829_whats_parallel_read_safe
Close #8829: doc: Update description of paralle-read-safe
2021-04-18 15:22:19 +09:00
Jakob Lykke Andersen
98800be904 Decl styling, make desc_inline node
Use the new node for cpp:expr
2021-04-12 19:06:44 +02:00
Jakob Lykke Andersen
3c9a74cb0b Decl styling, docs and restructuring 2021-04-12 19:05:58 +02:00
Takeshi KOMIYA
02016c0ef2 Close #8829: doc: Update description of paralle-read-safe 2021-04-04 13:35:12 +09:00
Brecht Machiels
ac0dcddeb8
Docs: fix typo in env-merge-info 2021-03-30 16:44:50 +02:00
Takeshi KOMIYA
6007bbf797 Deprecate DocumenterBridge.warn()
Since 1.6, sphinx.util.logging module became the default logging
interface of Sphinx. It allows sphinx-components to output log
without the app (or env) object.  According to the policy,
DocumenterBridge.warn() is no longer needed and should be replaced by
the logging module.
2021-03-22 23:51:54 +09:00
Takeshi KOMIYA
cb654d287b Rename DocumenterBridge.filename_set to record_dependencies
DocumenterBridge.filename_set has been used since its beginning.  On the
other hand, in docutils, record_dependencies attribute is well-used to
store the list of dependency files.  So this renames it to docutils'
standard attribute.
2021-03-21 00:52:53 +09:00
Takeshi KOMIYA
a523a89663 refactor: Add a type alias for the option_spec of directives; OptionSpec 2021-03-13 17:15:12 +09:00
Takeshi KOMIYA
fb4220d0a2 Close #8487: csv-table now considers abspath as relpath from srcdir
To make directives' behavior consistent, the :file: option for
csv-table directive now recognizes an absolute path as a relative
path from source directory.
2021-03-09 01:07:19 +09:00
Takeshi KOMIYA
0a3f897d15
Merge pull request #8432 from tk0miya/7119_pending_xref_condition
Fix #7119: Show type hint names unqualified when resolving succeeded
2021-03-06 17:32:27 +09:00
Takeshi KOMIYA
e1130972b2 Add pending_xref_condition node
To choose appropriate content for pending_xref node on resolving,
this introduces a new custom node `pending_xref_condition`.  It only
has a condition for the filtering and contents of the reference.
2021-03-06 02:01:03 +09:00
Takeshi KOMIYA
61c9c7fc58 Deprecate SphinxComponentRegistry.get_source_input()
The source_input system was deprecated at v2.0.  So no client uses it
longer now.  Therefore this deprecate the getter interface and its
usage.
2021-03-02 21:18:31 +09:00
Takeshi KOMIYA
def6f13d8d Merge branch '3.x' 2021-02-13 01:01:30 +09:00
Takeshi KOMIYA
5c223d20d6 refactor: linkcheck: Separate thread manager feature from builder class
To reduce the complexity of the linkcheck builder, this separates
the thread manager feature from the builder class as
HyperlinkAvailabilityChecker.
2021-02-12 23:19:01 +09:00
Takeshi KOMIYA
84458da828 Merge branch '3.x' 2021-02-07 17:01:09 +09:00
Takeshi KOMIYA
899ccfd40e refactor: linkcheck: Deprecate attributes of linkcheck builders
Move anchors_ignore, auth and to_ignore to
HyperlinkAvailabilityCheckWorker and become deprecated.
2021-02-07 02:39:35 +09:00
Takeshi KOMIYA
339ce2f894 Merge branch '3.x' 2021-01-30 11:49:08 +09:00
jfbu
185a2d27fe Fix #8780: long words in narrow columns may not be hyphenated
This is done by adding '\hskip0pt\relax\n' whenever a paragraph starts.
2021-01-29 00:24:44 +01:00
Takeshi KOMIYA
0e6a2a9ebd
Merge pull request #8737 from tk0miya/8510_html_logo_url
Allow user to use url to reference html logo & favicon
2021-01-24 14:40:56 +09:00
Takeshi KOMIYA
502c4ee5fb Merge branch '3.x' 2021-01-24 14:32:13 +09:00
Takeshi KOMIYA
15cbc6dbb0 Close #6550: html: Allow to use HTML permalink texts
Add new configuration variables: `html_permalinks` and
`html_permalinks_icon`.

This refines the settings around HTML permalinks.

* html_add_permalinks
  * Deprecated.
* html_permalinks
  * Enable or disable permalinks feature.
* html_permalinks_icon
  * Change the icon for permalinks
2021-01-24 14:17:07 +09:00
Takeshi KOMIYA
2626a74f0a doc: Show type annotations for methods of Sphinx application class 2021-01-24 00:08:04 +09:00
Takeshi KOMIYA
76d0a0be82 Update CHANGES 2021-01-23 20:45:03 +09:00
Takeshi KOMIYA
ccf4ae3729 Merge branch 'master' into 8510_html_logo_url 2021-01-23 20:44:13 +09:00
Takeshi KOMIYA
65a69965a1 html theme: Add favicon_url and logo_url
To embed the external favicon and logo image, this adds new template
variable `favicon_url` and `logo_url` that point the external URL or
relative path for the favicon/logo file from current file.  It helps to
use it on template files.
2021-01-23 20:39:09 +09:00
Takeshi KOMIYA
5ce72f465b Merge branch '3.x' 2021-01-22 22:52:32 +09:00
Takeshi KOMIYA
5260143afe Fix #8704: viewcode: anchors are generated in incremental build
The anchors for viewcode was generated in the reading phase only if
supported builder is used.  It causes anchors are missing on the
incremental build after the build for non supported builder.

This introduces `viewcode_anchor` node to insert the anchor even if non
supported builders.  They will be converted to the anchor tag in the
resolving phase for supported builders.  Or, they will be removed for
non supported builders.
2021-01-22 21:41:42 +09:00
François Freitag
aa5e4e2da0 Deprecate linkcheck builder {broken,good,redirected}
These attributes were used to cache checked links and avoid issuing
another web request to the same URI.

Since 82ef497a8c, links are pre-processed
to ensure uniqueness. This caching the results of checked links is no
longer useful.
2021-01-21 17:06:51 +01:00
Takeshi KOMIYA
82ef497a8c
Merge pull request #8702 from tk0miya/4304_linkcheck_same_url
linkcheck: Do not check the availability of the same URL repeatedly
2021-01-20 21:12:22 +09:00
Takeshi KOMIYA
cead0f6ddf linkcheck: Fix race condition that could lead to checking the availability of the same URL twice
So far, linkcheck scans all of references and images from documents, and
checks them parallel.  As a result, some URL would be checked twice (or
more) by race condition.

This collects the URL via post-transforms, and removes duplicated URLs
before checking availability.

refs: #4303
2021-01-20 20:58:27 +09:00
Takeshi KOMIYA
d49f3a1c78 refactor: autosummary: Deprecate _simple_info() and _simple_warn() 2021-01-20 02:23:34 +09:00
Takeshi KOMIYA
4cae0ecf86
Merge pull request #8690 from tk0miya/4550_align_default
Fix #4550: The align attribute of figure nodes becomes None by default
2021-01-18 02:14:27 +09:00
Takeshi KOMIYA
30f8640bab Merge branch '3.x' 2021-01-16 21:51:46 +09:00
Takeshi KOMIYA
3248bef3cc Fix #4550: The align attribute of figure nodes becomes None by default
To keep compatibility with the standard doctree model of docutils,
this stops to use 'default' value as a default value of the align
attribute for figure and table nodes.
2021-01-16 21:19:38 +09:00
Takeshi KOMIYA
dffb565eea refactor: Deprecate DocumenterBrdige.reporter
The logging system of Sphinx was migrated to sphinx.util.logging now.
So it's time to deprecate reporter interface for Documenters.
2021-01-12 01:48:16 +09:00
Takeshi KOMIYA
5460ea103b Merge branch '3.x' 2021-01-08 01:23:17 +09:00
Takeshi KOMIYA
af4e615a8a Close #6241: html: Allow to add JS/CSS files to the specific page
Allow to add JS/CSS files to the specific page when an extension calls
`app.add_js_file()` or `app.add_css_file()` on `html-page-context`
event.
2021-01-07 02:12:07 +09:00
Takeshi KOMIYA
62a0ee3fef Merge branch '3.x' 2020-12-31 14:33:09 +09:00
Takeshi KOMIYA
c0f923ee6c refactor: Deprecate AttributeDocumenter.isinstanceattribute() 2020-12-29 20:06:29 +09:00
Takeshi KOMIYA
a122397b4b Merge branch '3.x' 2020-12-29 18:37:45 +09:00
Takeshi KOMIYA
ce52a90d92 Fix #8592: autodoc: :meta public: does not effect to variables
To control the visibility of variables, ModuleDocumenter have to load
docstring of them on `get_object_members()` phase.  This reimplements
it and `get_module_members()` helper to fetch docstring on earlier
phase (as ClassDocumenter does).
2020-12-27 22:21:34 +09:00
Takeshi KOMIYA
140ef33469 Fix #7875: doc: Add PythonDomain.note_object() 2020-12-26 21:12:15 +09:00