mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Merge branch '5.0.x' into 5.x
This commit is contained in:
commit
f7a88441bf
2
CHANGES
2
CHANGES
@ -43,6 +43,8 @@ Bugs fixed
|
||||
``autodoc_typehints="description"``
|
||||
* #8180: autodoc: Docstring metadata ignored for attributes
|
||||
* #10443: epub: EPUB builder can't detect the mimetype of .webp file
|
||||
* #10104: gettext: Duplicated locations are shown if 3rd party extension does
|
||||
not provide correct information
|
||||
* #10456: py domain: ``:meta:`` fields are displayed if docstring contains two
|
||||
or more meta-field
|
||||
* #9096: sphinx-build: the value of progress bar for paralle build is wrong
|
||||
|
2
EXAMPLES
2
EXAMPLES
@ -40,7 +40,7 @@ Documentation using the alabaster theme
|
||||
* `pytest <https://docs.pytest.org/>`__ (customized)
|
||||
* `python-apt <https://apt-team.pages.debian.net/python-apt/>`__
|
||||
* `PyVisfile <https://documen.tician.de/pyvisfile/>`__
|
||||
* `Requests <https://docs.python-requests.org/>`__
|
||||
* `Requests <https://requests.readthedocs.io/>`__
|
||||
* `searx <https://asciimoo.github.io/searx/>`__
|
||||
* `Spyder <https://docs.spyder-ide.org/>`__ (customized)
|
||||
* `Tablib <http://docs.python-tablib.org/>`__
|
||||
|
@ -109,7 +109,7 @@ texinfo_documents = [
|
||||
|
||||
intersphinx_mapping = {
|
||||
'python': ('https://docs.python.org/3/', None),
|
||||
'requests': ('https://docs.python-requests.org/en/latest/', None),
|
||||
'requests': ('https://requests.readthedocs.io/en/latest/', None),
|
||||
'readthedocs': ('https://docs.readthedocs.io/en/stable', None),
|
||||
}
|
||||
|
||||
|
@ -592,6 +592,13 @@ __ https://pygments.org/docs/lexers
|
||||
|
||||
.. versionadded:: 1.3
|
||||
|
||||
.. rst:directive:option:: class: class names
|
||||
:type: a list of class names separated by spaces
|
||||
|
||||
The class name of the graph.
|
||||
|
||||
.. versionadded:: 1.4
|
||||
|
||||
.. rst:directive:option:: dedent: number
|
||||
:type: number or no value
|
||||
|
||||
@ -758,6 +765,9 @@ __ https://pygments.org/docs/lexers
|
||||
Added the ``diff``, ``lineno-match``, ``caption``, ``name``, and
|
||||
``dedent`` options.
|
||||
|
||||
.. versionchanged:: 1.4
|
||||
Added the ``class`` option.
|
||||
|
||||
.. versionchanged:: 1.5
|
||||
Added the ``start-at``, and ``end-at`` options.
|
||||
|
||||
|
@ -57,7 +57,8 @@ class Catalog:
|
||||
|
||||
def __iter__(self) -> Generator[Message, None, None]:
|
||||
for message in self.messages:
|
||||
positions = [(source, line) for source, line, uuid in self.metadata[message]]
|
||||
positions = sorted(set((source, line) for source, line, uuid
|
||||
in self.metadata[message]))
|
||||
uuids = [uuid for source, line, uuid in self.metadata[message]]
|
||||
yield Message(message, positions, uuids)
|
||||
|
||||
|
@ -8,9 +8,29 @@ from subprocess import PIPE, CalledProcessError
|
||||
|
||||
import pytest
|
||||
|
||||
from sphinx.builders.gettext import Catalog, MsgOrigin
|
||||
from sphinx.util.osutil import cd
|
||||
|
||||
|
||||
def test_Catalog_duplicated_message():
|
||||
catalog = Catalog()
|
||||
catalog.add('hello', MsgOrigin('/path/to/filename', 1))
|
||||
catalog.add('hello', MsgOrigin('/path/to/filename', 1))
|
||||
catalog.add('hello', MsgOrigin('/path/to/filename', 2))
|
||||
catalog.add('hello', MsgOrigin('/path/to/yetanother', 1))
|
||||
catalog.add('world', MsgOrigin('/path/to/filename', 1))
|
||||
|
||||
assert len(list(catalog)) == 2
|
||||
|
||||
msg1, msg2 = list(catalog)
|
||||
assert msg1.text == 'hello'
|
||||
assert msg1.locations == [('/path/to/filename', 1),
|
||||
('/path/to/filename', 2),
|
||||
('/path/to/yetanother', 1)]
|
||||
assert msg2.text == 'world'
|
||||
assert msg2.locations == [('/path/to/filename', 1)]
|
||||
|
||||
|
||||
@pytest.mark.sphinx('gettext', srcdir='root-gettext')
|
||||
def test_build_gettext(app):
|
||||
# Generic build; should fail only when the builder is horribly broken.
|
||||
|
Loading…
Reference in New Issue
Block a user