Skip to content

Commit

Permalink
Merge branch 'master' into literallyinclude-options
Browse files Browse the repository at this point in the history
  • Loading branch information
timhoffm authored Sep 6, 2024
2 parents 0b6b9dd + 0438178 commit 91f9162
Show file tree
Hide file tree
Showing 31 changed files with 575 additions and 423 deletions.
13 changes: 13 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ Incompatible changes

* #12763: Remove unused internal class ``sphinx.util.Tee``.
Patch by Adam Turner.
* #12822: LaTeX: for Unicode engines, the :ref:`fvset` default is changed to
``'\\fvset{fontsize=auto}'`` from ``'\\fvset{fontsize=\\small}'``.
Code-blokcs are unchanged as FreeMono is now loaded with ``Scale=0.9``.
An adjustement to existing projects is needed only if they used a custom
:ref:`fontpkg` configuration and did not set :ref:`fvset`.

Deprecated
----------
Expand Down Expand Up @@ -78,11 +83,19 @@ Bugs fixed
rise to nested ``\DUrole``'s, rather than a single one with comma separated
classes.
Patch by Jean-François B.
* #12831: LaTeX: avoid large voids sometimes occurring at page bottoms.
Patch by Jean-François B.
* #11970, #12551: singlehtml builder: make target URIs to be same-document
references in the sense of :rfc:`RFC 3986, §4.4 <3986#section-4.4>`,
e.g., ``index.html#foo`` becomes ``#foo``.
(note: continuation of a partial fix added in Sphinx 7.3.0)
Patch by James Addison (with reference to prior work by Eric Norige)
* #12735: Fix :pep:`695` generic classes LaTeX output formatting.
Patch by Jean-François B. and Bénédikt Tran.
* #12782: intersphinx: fix double forward slashes when generating the inventory
file URL (user-defined base URL of an intersphinx project are left untouched
even if they end with double forward slashes).
Patch by Bénédikt Tran.

Testing
-------
Expand Down
2 changes: 1 addition & 1 deletion doc/changes/3.5.rst
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ Features added
functions in source code and keep them not evaluated for readability.
* #8619: html: kbd role generates customizable HTML tags for compound keys
* #8634: html: Allow to change the order of JS/CSS via ``priority`` parameter
for :meth:`.Sphinx.add_js_file()` and :meth:`.Sphinx.add_css_file()`
for :meth:`.Sphinx.add_js_file` and :meth:`.Sphinx.add_css_file`
* #6241: html: Allow to add JS/CSS files to the specific page when an extension
calls ``app.add_js_file()`` or ``app.add_css_file()`` on
:event:`html-page-context` event
Expand Down
2 changes: 1 addition & 1 deletion doc/changes/4.4.rst
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Features added
by an extlink, suggesting a replacement.
* #9961: html: Support nested <kbd> HTML elements in other HTML builders
* #10013: html: Allow to change the loading method of JS via ``loading_method``
parameter for :meth:`.Sphinx.add_js_file()`
parameter for :meth:`.Sphinx.add_js_file`
* #9551: html search: "Hide Search Matches" link removes "highlight" parameter
from URL
* #9815: html theme: Wrap sidebar components in div to allow customizing their
Expand Down
23 changes: 15 additions & 8 deletions doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,16 @@
import os
import re
import time
from typing import TYPE_CHECKING

from sphinx import __display_version__
from sphinx import __display_version__, addnodes
from sphinx.application import Sphinx
from sphinx.environment import BuildEnvironment

if TYPE_CHECKING:
from pathlib import Path

from docutils import nodes

os.environ['SPHINX_AUTODOC_RELOAD_MODULES'] = '1'

Expand Down Expand Up @@ -254,13 +262,10 @@

# -- Extension interface -------------------------------------------------------

from sphinx import addnodes # NoQA: E402
from sphinx.application import Sphinx # NoQA: E402, TCH001

_event_sig_re = re.compile(r'([a-zA-Z-]+)\s*\((.*)\)')


def parse_event(env, sig, signode):
def parse_event(_env: BuildEnvironment, sig: str, signode: nodes.Element) -> str:
m = _event_sig_re.match(sig)
if m is None:
signode += addnodes.desc_name(sig, sig)
Expand All @@ -275,11 +280,13 @@ def parse_event(env, sig, signode):
return name


def linkify_issues_in_changelog(app, path, docname, source):
def linkify_issues_in_changelog(
_app: Sphinx, _path: Path, docname: str, source: list[str]
) -> None:
"""Linkify issue references like #123 in changelog to GitHub."""
if docname == 'changes':

def linkify(match):
def linkify(match: re.Match[str]) -> str:
url = 'https://github.com/sphinx-doc/sphinx/issues/' + match[1]
return f'`{match[0]} <{url}>`_'

Expand Down Expand Up @@ -338,7 +345,7 @@ def setup(app: Sphinx) -> None:
app.connect('include-read', linkify_issues_in_changelog)
app.connect('build-finished', build_redirects)
fdesc = GroupedField(
'parameter', label='Parameters', names=['param'], can_collapse=True
'parameter', label='Parameters', names=('param',), can_collapse=True
)
app.add_object_type(
'event',
Expand Down
2 changes: 1 addition & 1 deletion doc/development/html_themes/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ Python :mod:`configparser` module) and has the following structure:
* The **pygments_dark_style** setting gives the name of a Pygments style to use
for highlighting when the CSS media query ``(prefers-color-scheme: dark)``
evaluates to true. It is injected into the page using
:meth:`~sphinx.application.Sphinx.add_css_file()`.
:meth:`~sphinx.application.Sphinx.add_css_file`.

* The **sidebars** setting gives the comma separated list of sidebar templates
for constructing sidebars. This can be overridden by the user in the
Expand Down
28 changes: 14 additions & 14 deletions doc/extdev/deprecated.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1447,12 +1447,12 @@ The following is a list of deprecated interfaces.
* - :meth:`!add_stylesheet`
- 1.8
- 6.0
- :meth:`~sphinx.application.Sphinx.add_css_file()`
- :meth:`~sphinx.application.Sphinx.add_css_file`

* - :meth:`!add_javascript()`
* - :meth:`!add_javascript`
- 1.8
- 4.0
- :meth:`~sphinx.application.Sphinx.add_js_file()`
- :meth:`~sphinx.application.Sphinx.add_js_file`

* - :confval:`autodoc_default_flags`
- 1.8
Expand Down Expand Up @@ -1519,7 +1519,7 @@ The following is a list of deprecated interfaces.
* - ``sphinx.ext.mathbase.setup_math()``
- 1.8
- 3.0
- :meth:`~sphinx.application.Sphinx.add_html_math_renderer()`
- :meth:`~sphinx.application.Sphinx.add_html_math_renderer`

* - ``sphinx.ext.mathbase.is_in_section_title()``
- 1.8
Expand Down Expand Up @@ -1700,18 +1700,18 @@ The following is a list of deprecated interfaces.
* - ``Sphinx.override_domain()``
- 1.8
- 3.0
- :meth:`~sphinx.application.Sphinx.add_domain()`
- :meth:`~sphinx.application.Sphinx.add_domain`

* - ``Sphinx.import_object()``
- 1.8
- 3.0
- ``sphinx.util.import_object()``

* - ``suffix`` argument of
:meth:`~sphinx.application.Sphinx.add_source_parser()`
:meth:`~sphinx.application.Sphinx.add_source_parser`
- 1.8
- 3.0
- :meth:`~sphinx.application.Sphinx.add_source_suffix()`
- :meth:`~sphinx.application.Sphinx.add_source_suffix`


* - ``BuildEnvironment.load()``
Expand Down Expand Up @@ -1792,7 +1792,7 @@ The following is a list of deprecated interfaces.
* - :confval:`!source_parsers`
- 1.8
- 3.0
- :meth:`~sphinx.application.Sphinx.add_source_parser()`
- :meth:`~sphinx.application.Sphinx.add_source_parser`

* - ``sphinx.util.docutils.directive_helper()``
- 1.8
Expand All @@ -1812,17 +1812,17 @@ The following is a list of deprecated interfaces.
* - ``sphinx.locale.l_()``
- 1.8
- 3.0
- :func:`sphinx.locale._()`
- :func:`sphinx.locale._`

* - ``sphinx.locale.lazy_gettext()``
- 1.8
- 3.0
- :func:`sphinx.locale._()`
- :func:`sphinx.locale._`

* - ``sphinx.locale.mygettext()``
- 1.8
- 3.0
- :func:`sphinx.locale._()`
- :func:`sphinx.locale._`

* - ``sphinx.util.copy_static_entry()``
- 1.5
Expand Down Expand Up @@ -1857,17 +1857,17 @@ The following is a list of deprecated interfaces.
* - ``sphinx.ext.autodoc.add_documenter()``
- 1.7
- 2.0
- :meth:`~sphinx.application.Sphinx.add_autodocumenter()`
- :meth:`~sphinx.application.Sphinx.add_autodocumenter`

* - ``sphinx.ext.autodoc.AutoDirective._register``
- 1.7
- 2.0
- :meth:`~sphinx.application.Sphinx.add_autodocumenter()`
- :meth:`~sphinx.application.Sphinx.add_autodocumenter`

* - ``AutoDirective._special_attrgetters``
- 1.7
- 2.0
- :meth:`~sphinx.application.Sphinx.add_autodoc_attrgetter()`
- :meth:`~sphinx.application.Sphinx.add_autodoc_attrgetter`

* - ``Sphinx.warn()``, ``Sphinx.info()``
- 1.6
Expand Down
4 changes: 4 additions & 0 deletions doc/extdev/domainapi.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ Domain API
.. autoclass:: Index
:members:

.. autoclass:: IndexEntry
:members:
:member-order: bysource

.. module:: sphinx.directives

.. autoclass:: ObjectDescription
Expand Down
2 changes: 1 addition & 1 deletion doc/extdev/parserapi.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ __ https://docutils.sourceforge.io/docs/dev/hacking.html#parsing-the-document

In Sphinx, the parser modules works as same as docutils. The parsers are
registered to Sphinx by extensions using Application APIs;
:meth:`.Sphinx.add_source_suffix()` and :meth:`.Sphinx.add_source_parser()`.
:meth:`.Sphinx.add_source_suffix` and :meth:`.Sphinx.add_source_parser`.

The *source suffix* is a mapping from file suffix to file type. For example,
``.rst`` file is mapped to ``'restructuredtext'`` type. Sphinx uses the
Expand Down
Loading

0 comments on commit 91f9162

Please sign in to comment.