mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Merge branch '4.x' into 9708_needs_extension_logic
This commit is contained in:
4
CHANGES
4
CHANGES
@@ -39,6 +39,8 @@ Features added
|
||||
* C++, added new info-field ``retval`` for :rst:dir:`cpp:function`.
|
||||
* #9672: More CSS classes on Python domain descriptions
|
||||
* #9695: More CSS classes on Javascript domain descriptions
|
||||
* #9683: Revert the removal of ``add_stylesheet()`` API. It will be kept until
|
||||
the Sphinx-6.0 release
|
||||
|
||||
Bugs fixed
|
||||
----------
|
||||
@@ -59,6 +61,8 @@ Bugs fixed
|
||||
* #9649: HTML search: when objects have the same name but in different domains,
|
||||
return all of them as result instead of just one.
|
||||
* #9678: linkcheck: file extension was shown twice in warnings
|
||||
* #9697: py domain: An index entry with parens was registered for ``py:method``
|
||||
directive with ``:property:`` option
|
||||
* #9708: needs_extension failed to check double-digit version correctly
|
||||
|
||||
Testing
|
||||
|
||||
@@ -1212,7 +1212,7 @@ The following is a list of deprecated interfaces.
|
||||
|
||||
* - :meth:`~sphinx.application.Sphinx.add_stylesheet()`
|
||||
- 1.8
|
||||
- 4.0
|
||||
- 6.0
|
||||
- :meth:`~sphinx.application.Sphinx.add_css_file()`
|
||||
|
||||
* - :meth:`~sphinx.application.Sphinx.add_javascript()`
|
||||
|
||||
@@ -1046,6 +1046,26 @@ class Sphinx:
|
||||
if hasattr(self.builder, 'add_css_file'):
|
||||
self.builder.add_css_file(filename, priority=priority, **kwargs) # type: ignore
|
||||
|
||||
def add_stylesheet(self, filename: str, alternate: bool = False, title: str = None
|
||||
) -> None:
|
||||
"""An alias of :meth:`add_css_file`.
|
||||
|
||||
.. deprecated:: 1.8
|
||||
"""
|
||||
logger.warning('The app.add_stylesheet() is deprecated. '
|
||||
'Please use app.add_css_file() instead.')
|
||||
|
||||
attributes = {} # type: Dict[str, Any]
|
||||
if alternate:
|
||||
attributes['rel'] = 'alternate stylesheet'
|
||||
else:
|
||||
attributes['rel'] = 'stylesheet'
|
||||
|
||||
if title:
|
||||
attributes['title'] = title
|
||||
|
||||
self.add_css_file(filename, **attributes)
|
||||
|
||||
def add_latex_package(self, packagename: str, options: str = None,
|
||||
after_hyperref: bool = False) -> None:
|
||||
r"""Register a package to include in the LaTeX source code.
|
||||
|
||||
@@ -796,7 +796,7 @@ class PyMethod(PyObject):
|
||||
if 'classmethod' in self.options:
|
||||
return _('%s() (%s class method)') % (methname, clsname)
|
||||
elif 'property' in self.options:
|
||||
return _('%s() (%s property)') % (methname, clsname)
|
||||
return _('%s (%s property)') % (methname, clsname)
|
||||
elif 'staticmethod' in self.options:
|
||||
return _('%s() (%s static method)') % (methname, clsname)
|
||||
else:
|
||||
|
||||
@@ -756,7 +756,7 @@ def test_pymethod_options(app):
|
||||
|
||||
# :property:
|
||||
assert_node(doctree[1][1][8], addnodes.index,
|
||||
entries=[('single', 'meth5() (Class property)', 'Class.meth5', '', None)])
|
||||
entries=[('single', 'meth5 (Class property)', 'Class.meth5', '', None)])
|
||||
assert_node(doctree[1][1][9], ([desc_signature, ([desc_annotation, ("property", desc_sig_space)],
|
||||
[desc_name, "meth5"])],
|
||||
[desc_content, ()]))
|
||||
|
||||
Reference in New Issue
Block a user