Commit Graph

188 Commits

Author SHA1 Message Date
Adam Turner
6a56592b30 Move cross-referencing to a new page 2023-10-03 19:32:37 +01:00
Adam Turner
05682f12a6 Restore `usage/restructuredtext/domains` 2023-10-02 13:10:11 +01:00
Adam Turner
c0e17eca40 Move the domains reference up one level 2023-10-02 13:09:38 +01:00
Nikita Sobolev
1bd261c3a0
Fix a typo in the `:final:` option for methods (#11670) 2023-09-14 09:50:49 +01:00
Hugo van Kemenade
359edc34fc
Use the Python 3 `print()` function in the documentation (#11683) 2023-09-14 09:45:20 +01:00
blaisep
b0fe730146 Fix #11407 adjust the spelling in the example. 2023-07-30 15:08:49 +02:00
Adam Turner
1cfb68d8be
Consistently name the object description options (#11533)
*  The directive option ``:noindex:`` was renamed to ``:no-index:``.
*  The directive option ``:noindexentry:`` was renamed to ``:no-index-entry:``.
*  The directive option ``:nocontentsentry:`` was renamed to ``:no-contents-entry:``.

The previous names are retained as aliases, but will be deprecated
and removed in a future version of Sphinx (9.0 or later).
2023-07-28 22:30:26 +01:00
latosha-maltba
97d2c5da2f
Add the `:no-typesetting:` option for only creating targets (#10478)
Co-authored-by: Adam Turner <9087854+aa-turner@users.noreply.github.com>
2023-07-28 19:43:27 +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
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
Adam Turner
de3aa8a318 Replace non-functional Bitbucket URLs
- ``sphinx-contrib`` has moved to GitHub
- Replace personal project links with links to the Bitbucket archive
2023-07-14 06:52:25 +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
Hugo van Kemenade
318914fff2
Fix syntax in `:manpage:` role example (#11249) 2023-03-24 01:36:58 +00:00
Hugo van Kemenade
ba4c67b1dc
Display examples of roles in the documentation (#11226)
Show examples of roles in the docs so we can see how they look. 
Seeing how roles are displayed helps us decide whether to use them.
2023-03-17 15:05:09 +00:00
Hugo van Kemenade
7f62f539be
Correct the Python Developer Guide markup style advice link (#11189) 2023-02-11 13:19:51 +00:00
Hugo van Kemenade
dc29bf9abe
Docs: Update devguide link (#11017)
Update devguide link
2022-12-16 16:42:11 +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
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
0a91adb64d
Extend cross referencing options with values (#10883)
This change means that text following `=`, `[=`, or ` ` is ignored when
searching for a corresponding option directive to an option cross reference
role. These are commonly used options, for example `--profile=path`, 
`--profile[=path]` or `--profile path`.

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2022-10-02 15:50:53 +01:00
Adam Turner
63dea6172a Merge branch '5.x'
# Conflicts:
#	sphinx/locale/__init__.py
2022-09-30 16:15:24 +01:00
Adam Turner
2906071198 Merge branch '5.2.x' into 5.x
# Conflicts:
#	CHANGES
#	sphinx/__init__.py
2022-09-30 16:13:11 +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
Martin Liska
29e6adab12 extend option directive syntax
One can cross-reference an option value: :option:`--module=foobar`.
2022-09-27 19:02:45 +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
Jean-François B
80198e82aa Merge branch '5.x' into master
Resolved merge conflicts:
    sphinx/ext/extlinks.py
    sphinx/ext/napoleon/docstring.py
    (and removed from the latter a now unused import for flake8 F401
    compliance)
2022-06-30 15:00:16 +02:00
Adam Turner
ac0fc4b781
Remove more deprecated items in Sphinx 6.0 (#10562) 2022-06-26 15:01:09 +01:00
jfbu
f74cc3fcaa Minor cross-linking improvements in usage/restructuredtext/roles.rst 2022-06-26 09:51:39 +02:00
jfbu
8ecbe8a15a Improve mark-up in docs (follow-up to PR #10366) 2022-06-26 09:30:22 +02:00
Adam Turner
70f950cae0
Remove traces of Python 2 and 3.5 (#10560) 2022-06-16 21:37:46 +01:00
Martin Liška
f789148fa2
Allow emphasising placeholders in option directives (#10366)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2022-06-16 20:46:01 +01:00
Takeshi KOMIYA
1856ee638b Close #10461: doc: Add an explanation for :class: option of code-block directive 2022-05-22 16:03:33 +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
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
08f5d97a82 Fix #10223: doc: Add descriptions of :module: option for python directives 2022-03-06 16:10:40 +09:00
Noah Sprent
25c4287da5
Remove commas when describing characters for section headings 2022-02-02 10:52:06 +01:00
Takeshi KOMIYA
6611140c76 Merge branch '4.x' into HEAD 2022-01-15 19:46:45 +09:00
Jean Abou Samra
0269bec1ed In translated docs, sort glossaries by translated terms
This is done by moving the sorting from the glossary directive to a
transform operating after the i18n transform.

Closes #9827
2022-01-12 16:47:40 +01:00
Takeshi KOMIYA
be36cf471b
Merge pull request #9679 from latosha-maltba/doc/directive-indent
Document indent behaviour for directives
2021-10-09 16:26:52 +09:00
Takeshi KOMIYA
481c5e9c4b
Merge pull request #9534 from astrojuanlu/new-tutorial-describing-code
New Sphinx tutorial, part III
2021-10-09 13:05:48 +09:00
Jakob Lykke Andersen
a6246c1b65 Typo fixes 2021-10-01 20:48:12 +02:00
Jakob Lykke Andersen
91d0289009 C++, add retval info field to cpp:function 2021-10-01 20:47:14 +02:00
Jakob Lykke Andersen
57fad5c044 C, update documentation for info-fields 2021-10-01 18:38:30 +02:00
Latosha Maltba
ee3f361992 Document indent behaviour for directives
Mention how the indent of the contents for directives is chosen and what
the effect on directives which are sensitive to whitespace is,
e.g. code-block.
2021-09-27 09:06:52 +00:00
Latosha Maltba
54b1991e74 Update :dedent: example
The presence or absence of the ``:dedent: 4`` option in the example

.. code-block:: ruby
   :dedent: 4

       some ruby code

makes no difference for the output due to how ReST handles whitespace.
If it is present, then ReST indent is 3 and the 4 spaces of the code are
stripped by the :dedent: option.  If the dedent option is missing, then
the ReST indent is 7 and all whitespace is stripped again.

Add a dummy option to fixate the ReST indent to 3, so adding and
removing of the option in the example has an effect on the output.
2021-09-23 07:52:39 +00:00
Juan Luis Cano Rodríguez
2c1fa831c1 Add tutorial section on documenting Python objects 2021-08-12 20:06:56 +02:00
Takeshi KOMIYA
120525563c Cloase #9445: :py:property: directive now supports :classmethod: option
Since python 3.9, `classmethod` starts to support creating a "class
property".  This allows to describe it.
2021-07-17 14:24:31 +09:00