Merge branch '4.x'

This commit is contained in:
Takeshi KOMIYA 2021-09-11 17:13:21 +09:00
commit 2c21e91b5f
39 changed files with 65 additions and 63 deletions

11
CHANGES
View File

@ -62,6 +62,7 @@ Bugs fixed
* #9481: cpp domain: some warnings contain non-existing filenames * #9481: cpp domain: some warnings contain non-existing filenames
* #9456: html search: abbreation marks are inserted to the search result if * #9456: html search: abbreation marks are inserted to the search result if
failed to fetch the content of the page failed to fetch the content of the page
* #9617: html search: The JS requirement warning is shown if browser is slow
* #9267: html theme: CSS and JS files added by theme were loaded twice * #9267: html theme: CSS and JS files added by theme were loaded twice
* #9585: py domain: ``:type:`` option for :rst:dir:`py:property` directive does * #9585: py domain: ``:type:`` option for :rst:dir:`py:property` directive does
not create a hyperlink not create a hyperlink
@ -335,7 +336,7 @@ Incompatible changes
``autodoc_typehints='description'`` and ``autoclass_content='class'`` set ``autodoc_typehints='description'`` and ``autoclass_content='class'`` set
* #8898: extlinks: "%s" becomes required keyword in the link caption string * #8898: extlinks: "%s" becomes required keyword in the link caption string
* domain: The ``Index`` class becomes subclasses of ``abc.ABC`` to indicate * domain: The ``Index`` class becomes subclasses of ``abc.ABC`` to indicate
methods that must be overrided in the concrete classes methods that must be overridden in the concrete classes
* #4826: py domain: The structure of python objects is changed. A boolean value * #4826: py domain: The structure of python objects is changed. A boolean value
is added to indicate that the python object is canonical one is added to indicate that the python object is canonical one
* #7425: MathJax: The MathJax was changed from 2 to 3. Users using a custom * #7425: MathJax: The MathJax was changed from 2 to 3. Users using a custom
@ -1047,7 +1048,7 @@ Bugs fixed
module has submodules module has submodules
* #4258: napoleon: decorated special methods are not shown * #4258: napoleon: decorated special methods are not shown
* #7799: napoleon: parameters are not escaped for combined params in numpydoc * #7799: napoleon: parameters are not escaped for combined params in numpydoc
* #7780: napoleon: multiple paramaters declaration in numpydoc was wrongly * #7780: napoleon: multiple parameters declaration in numpydoc was wrongly
recognized when napoleon_use_params=True recognized when napoleon_use_params=True
* #7715: LaTeX: ``numfig_secnum_depth > 1`` leads to wrong figure links * #7715: LaTeX: ``numfig_secnum_depth > 1`` leads to wrong figure links
* #7846: html theme: XML-invalid files were generated * #7846: html theme: XML-invalid files were generated
@ -1413,7 +1414,7 @@ Incompatible changes
has been renamed to ``sphinx_line_type``. has been renamed to ``sphinx_line_type``.
* #6462: double backslashes in domain directives are no longer replaced by * #6462: double backslashes in domain directives are no longer replaced by
single backslashes as default. A new configuration value single backslashes as default. A new configuration value
:confval:`strip_signature_backslash` can be used by users to reenable it. :confval:`strip_signature_backslash` can be used by users to re-enable it.
3.0.0 final 3.0.0 final
@ -1486,7 +1487,7 @@ Features added
- Cross-referencing respecting the current scope. - Cross-referencing respecting the current scope.
- Possible to document anonymous entities. - Possible to document anonymous entities.
- More specific directives and roles for each type of entitiy, - More specific directives and roles for each type of entity,
e.g., handling scoping of enumerators. e.g., handling scoping of enumerators.
- New role :rst:role:`c:expr` for rendering expressions and types - New role :rst:role:`c:expr` for rendering expressions and types
in text. in text.
@ -1873,7 +1874,7 @@ Features added
* #6533: LaTeX: refactor visit_enumerated_list() to use ``\sphinxsetlistlabels`` * #6533: LaTeX: refactor visit_enumerated_list() to use ``\sphinxsetlistlabels``
* #6628: quickstart: Use ``https://docs.python.org/3/`` for default setting of * #6628: quickstart: Use ``https://docs.python.org/3/`` for default setting of
:confval:`intersphinx_mapping` :confval:`intersphinx_mapping`
* #6419: sphinx-build: give reasons why rebuilded * #6419: sphinx-build: give reasons why rebuilt
Bugs fixed Bugs fixed
---------- ----------

View File

@ -574,7 +574,7 @@ The colors used in the above are provided by the ``svgnames`` option of the
It is possible to insert further uses of the ``\sphinxsetup`` LaTeX macro It is possible to insert further uses of the ``\sphinxsetup`` LaTeX macro
directly into the body of the document, via the help of the :rst:dir:`raw` directly into the body of the document, via the help of the :rst:dir:`raw`
directive. This chapter is styled in the PDF output using the following at the directive. This chapter is styled in the PDF output using the following at the
start of the chaper:: start of the chapter::
.. raw:: latex .. raw:: latex
@ -607,7 +607,7 @@ macros may be significant.
Do not use quotes to enclose values, whether numerical or strings. Do not use quotes to enclose values, whether numerical or strings.
``bookmarksdepth`` ``bookmarksdepth``
Controls the depth of the collapsable bookmarks panel in the PDF. Controls the depth of the collapsible bookmarks panel in the PDF.
May be either a number (e.g. ``3``) or a LaTeX sectioning name (e.g. May be either a number (e.g. ``3``) or a LaTeX sectioning name (e.g.
``subsubsection``, i.e. without backslash). ``subsubsection``, i.e. without backslash).
For details, refer to the ``hyperref`` LaTeX docs. For details, refer to the ``hyperref`` LaTeX docs.

View File

@ -35,7 +35,7 @@ Options
.. option:: --no-sep .. option:: --no-sep
If specified, create build directroy under source directroy. If specified, create build directory under source directory.
.. option:: --dot=DOT .. option:: --dot=DOT

View File

@ -83,7 +83,7 @@ It adds these directives:
.. versionadded:: 1.6 .. versionadded:: 1.6
.. rst:directive:option:: class: class names .. rst:directive:option:: class: class names
:type: a list of class names separeted by spaces :type: a list of class names separated by spaces
The class name of the graph. The class name of the graph.
@ -139,7 +139,7 @@ It adds these directives:
.. versionadded:: 1.6 .. versionadded:: 1.6
.. rst:directive:option:: class: class names .. rst:directive:option:: class: class names
:type: a list of class names separeted by spaces :type: a list of class names separated by spaces
The class name of the graph. The class name of the graph.
@ -191,7 +191,7 @@ It adds these directives:
.. versionadded:: 1.6 .. versionadded:: 1.6
.. rst:directive:option:: class: class names .. rst:directive:option:: class: class names
:type: a list of class names separeted by spaces :type: a list of class names separated by spaces
The class name of the graph. The class name of the graph.

View File

@ -176,7 +176,7 @@ else:
setup( setup(
name='Sphinx', name='Sphinx',
version=sphinx.__version__, version=sphinx.__version__,
url='https://sphinx-doc.org/', url='https://www.sphinx-doc.org/',
download_url='https://pypi.org/project/Sphinx/', download_url='https://pypi.org/project/Sphinx/',
license='BSD', license='BSD',
author='Georg Brandl', author='Georg Brandl',

View File

@ -143,7 +143,7 @@ class EpubBuilder(StandaloneHTMLBuilder):
embedded = True embedded = True
# disable download role # disable download role
download_support = False download_support = False
# dont' create links to original images from images # don't create links to original images from images
html_scaled_image_link = False html_scaled_image_link = False
# don't generate search index or include search page # don't generate search index or include search page
search = False search = False

View File

@ -199,7 +199,7 @@ ADDITIONAL_SETTINGS: Dict[Any, Dict[str, Any]] = {
'babel': '\\usepackage{babel}', 'babel': '\\usepackage{babel}',
'fontenc': '\\usepackage{xeCJK}', 'fontenc': '\\usepackage{xeCJK}',
# set formatcom=\xeCJKVerbAddon to prevent xeCJK from adding extra spaces in # set formatcom=\xeCJKVerbAddon to prevent xeCJK from adding extra spaces in
# fancyvrb Verbatim enviroment. # fancyvrb Verbatim environment.
'fvset': '\\fvset{fontsize=\\small,formatcom=\\xeCJKVerbAddon}', 'fvset': '\\fvset{fontsize=\\small,formatcom=\\xeCJKVerbAddon}',
}, },
('xelatex', 'el'): { ('xelatex', 'el'): {

View File

@ -415,7 +415,7 @@ def check_confval_types(app: "Sphinx", config: Config) -> None:
if hasattr(default, '__call__'): if hasattr(default, '__call__'):
default = default(config) # evaluate default value default = default(config) # evaluate default value
if default is None and not annotations: if default is None and not annotations:
continue # neither inferrable nor expliclitly annotated types continue # neither inferable nor expliclitly annotated types
if annotations is Any: if annotations is Any:
# any type of value is accepted # any type of value is accepted

View File

@ -2255,7 +2255,7 @@ class DefinitionParser(BaseParser):
def _parse_initializer_list(self, name: str, open: str, close: str def _parse_initializer_list(self, name: str, open: str, close: str
) -> Tuple[List[ASTExpression], bool]: ) -> Tuple[List[ASTExpression], bool]:
# Parse open and close with the actual initializer-list inbetween # Parse open and close with the actual initializer-list in between
# -> initializer-clause '...'[opt] # -> initializer-clause '...'[opt]
# | initializer-list ',' initializer-clause '...'[opt] # | initializer-list ',' initializer-clause '...'[opt]
# TODO: designators # TODO: designators
@ -3446,7 +3446,7 @@ class CNamespacePopObject(SphinxDirective):
def run(self) -> List[Node]: def run(self) -> List[Node]:
stack = self.env.temp_data.get('c:namespace_stack', None) stack = self.env.temp_data.get('c:namespace_stack', None)
if not stack or len(stack) == 0: if not stack or len(stack) == 0:
logger.warning("C namespace pop on empty stack. Defaulting to gobal scope.", logger.warning("C namespace pop on empty stack. Defaulting to global scope.",
location=self.get_location()) location=self.get_location())
stack = [] stack = []
else: else:

View File

@ -162,7 +162,7 @@ T = TypeVar('T')
trailing-type-specifier -> trailing-type-specifier ->
rest-of-trailing rest-of-trailing
("class" | "struct" | "union" | "typename") rest-of-trailing ("class" | "struct" | "union" | "typename") rest-of-trailing
build-in -> "char" | "bool" | etc. built-in -> "char" | "bool" | etc.
decltype-specifier decltype-specifier
rest-of-trailing -> (with some simplification) rest-of-trailing -> (with some simplification)
"::"[opt] list-of-elements-separated-by-:: "::"[opt] list-of-elements-separated-by-::
@ -1709,7 +1709,7 @@ class ASTOperatorBuildIn(ASTOperator):
else: else:
ids = _id_operator_v2 ids = _id_operator_v2
if self.op not in ids: if self.op not in ids:
raise Exception('Internal error: Build-in operator "%s" can not ' raise Exception('Internal error: Built-in operator "%s" can not '
'be mapped to an id.' % self.op) 'be mapped to an id.' % self.op)
return ids[self.op] return ids[self.op]
@ -2479,7 +2479,7 @@ class ASTDeclaratorNameParamQual(ASTDeclarator):
def get_type_id(self, version: int, returnTypeId: str) -> str: def get_type_id(self, version: int, returnTypeId: str) -> str:
assert version >= 2 assert version >= 2
res = [] res = []
# TOOD: can we actually have both array ops and paramQual? # TODO: can we actually have both array ops and paramQual?
res.append(self.get_ptr_suffix_id(version)) res.append(self.get_ptr_suffix_id(version))
if self.paramQual: if self.paramQual:
res.append(self.get_modifiers_id(version)) res.append(self.get_modifiers_id(version))
@ -5217,7 +5217,7 @@ class DefinitionParser(BaseParser):
) -> Tuple[List[Union[ASTExpression, ) -> Tuple[List[Union[ASTExpression,
ASTBracedInitList]], ASTBracedInitList]],
bool]: bool]:
# Parse open and close with the actual initializer-list inbetween # Parse open and close with the actual initializer-list in between
# -> initializer-clause '...'[opt] # -> initializer-clause '...'[opt]
# | initializer-list ',' initializer-clause '...'[opt] # | initializer-list ',' initializer-clause '...'[opt]
self.skip_ws() self.skip_ws()
@ -6358,7 +6358,7 @@ class DefinitionParser(BaseParser):
if outer in ('type', 'function'): if outer in ('type', 'function'):
# We allow type objects to just be a name. # We allow type objects to just be a name.
# Some functions don't have normal return types: constructors, # Some functions don't have normal return types: constructors,
# destrutors, cast operators # destructors, cast operators
prevErrors = [] prevErrors = []
startPos = self.pos startPos = self.pos
# first try without the type # first try without the type
@ -6562,7 +6562,7 @@ class DefinitionParser(BaseParser):
self.fail("Expected 'typename' or 'class' after " self.fail("Expected 'typename' or 'class' after "
"template template parameter list.") "template template parameter list.")
else: else:
self.fail("Expected 'typename' or 'class' in tbe " self.fail("Expected 'typename' or 'class' in the "
"beginning of template type parameter.") "beginning of template type parameter.")
self.skip_ws() self.skip_ws()
parameterPack = self.skip_string('...') parameterPack = self.skip_string('...')
@ -7282,7 +7282,7 @@ class CPPNamespacePopObject(SphinxDirective):
def run(self) -> List[Node]: def run(self) -> List[Node]:
stack = self.env.temp_data.get('cpp:namespace_stack', None) stack = self.env.temp_data.get('cpp:namespace_stack', None)
if not stack or len(stack) == 0: if not stack or len(stack) == 0:
logger.warning("C++ namespace pop on empty stack. Defaulting to gobal scope.", logger.warning("C++ namespace pop on empty stack. Defaulting to global scope.",
location=self.get_location()) location=self.get_location())
stack = [] stack = []
else: else:

View File

@ -1062,7 +1062,7 @@ class PythonModuleIndex(Index):
# list of all modules, sorted by module name # list of all modules, sorted by module name
modules = sorted(self.domain.data['modules'].items(), modules = sorted(self.domain.data['modules'].items(),
key=lambda x: x[0].lower()) key=lambda x: x[0].lower())
# sort out collapsable modules # sort out collapsible modules
prev_modname = '' prev_modname = ''
num_toplevels = 0 num_toplevels = 0
for modname, (docname, node_id, synopsis, platforms, deprecated) in modules: for modname, (docname, node_id, synopsis, platforms, deprecated) in modules:

View File

@ -107,7 +107,7 @@ class IndexEntries:
lckey = lckey[1:] lckey = lckey[1:]
if lckey[0:1].isalpha() or lckey.startswith('_'): if lckey[0:1].isalpha() or lckey.startswith('_'):
# put non-symbol characters at the folloing group (1) # put non-symbol characters at the following group (1)
sortkey = (1, lckey) sortkey = (1, lckey)
else: else:
# put symbols at the front of the index (0) # put symbols at the front of the index (0)

View File

@ -1424,7 +1424,7 @@ _METACLASS_CALL_BLACKLIST = [
] ]
# Types whose __new__ signature is a pass-thru. # Types whose __new__ signature is a pass-through.
_CLASS_NEW_BLACKLIST = [ _CLASS_NEW_BLACKLIST = [
'typing.Generic.__new__', 'typing.Generic.__new__',
] ]
@ -1613,7 +1613,7 @@ class ClassDocumenter(DocstringSignatureMixin, ModuleLevelDocumenter): # type:
if qualname in analyzer.overloads: if qualname in analyzer.overloads:
return analyzer.overloads.get(qualname) return analyzer.overloads.get(qualname)
elif qualname in analyzer.tagorder: elif qualname in analyzer.tagorder:
# the constructor is defined in the class, but not overrided. # the constructor is defined in the class, but not overridden.
return [] return []
except PycodeError: except PycodeError:
pass pass

View File

@ -224,7 +224,7 @@ def get_documenter(app: Sphinx, obj: Any, parent: Any) -> Type[Documenter]:
else: else:
parent_doc = parent_doc_cls(FakeDirective(), "") parent_doc = parent_doc_cls(FakeDirective(), "")
# Get the corrent documenter class for *obj* # Get the correct documenter class for *obj*
classes = [cls for cls in app.registry.documenters.values() classes = [cls for cls in app.registry.documenters.values()
if cls.can_document_member(obj, '', False, parent_doc)] if cls.can_document_member(obj, '', False, parent_doc)]
if classes: if classes:

View File

@ -16,7 +16,7 @@
\ifdefined\pdfimageresolution \ifdefined\pdfimageresolution
\pdfimageresolution= \numexpr \dimexpr1in\relax/\sphinxpxdimen\relax \pdfimageresolution= \numexpr \dimexpr1in\relax/\sphinxpxdimen\relax
\fi \fi
%% let collapsable pdf bookmarks panel have high depth per default %% let collapsible pdf bookmarks panel have high depth per default
\PassOptionsToPackage{bookmarksdepth=5}{hyperref} \PassOptionsToPackage{bookmarksdepth=5}{hyperref}
<% if use_xindy -%> <% if use_xindy -%>
%% turn off hyperref patch of \index as sphinx.xdy xindy module takes care of %% turn off hyperref patch of \index as sphinx.xdy xindy module takes care of

View File

@ -24,7 +24,7 @@
;; covered by original tex/inputenc/utf8.xdy. ;; covered by original tex/inputenc/utf8.xdy.
;; ;;
;; - There is a problem that ȷ is not supported out-of-the box by LaTeX ;; - There is a problem that ȷ is not supported out-of-the box by LaTeX
;; with inputenc, one must add explicitely ;; with inputenc, one must add explicitly
;; \DeclareUnicodeCharacter{0237}{\j} ;; \DeclareUnicodeCharacter{0237}{\j}
;; to preamble of LaTeX document. However this character is not supported ;; to preamble of LaTeX document. However this character is not supported
;; by the TeX "times" font used by default by Sphinx for pdflatex engine. ;; by the TeX "times" font used by default by Sphinx for pdflatex engine.

View File

@ -77,7 +77,7 @@
% \DeclareStringOption is not convenient for the handling of these dimensions % \DeclareStringOption is not convenient for the handling of these dimensions
% because we want to assign the values to the corresponding registers. Even if % because we want to assign the values to the corresponding registers. Even if
% we added the code to the key handler it would be too late for the initial % we added the code to the key handler it would be too late for the initial
% set-up and we would need to do initial assignments explicitely. We end up % set-up and we would need to do initial assignments explicitly. We end up
% using \define@key directly. % using \define@key directly.
% verbatim % verbatim
\sphinxverbatimsep=\fboxsep \sphinxverbatimsep=\fboxsep

View File

@ -15,7 +15,7 @@
;; xindy base module latex.xdy loads tex.xdy and the latter instructs ;; xindy base module latex.xdy loads tex.xdy and the latter instructs
;; xindy to ignore **all** TeX macros in .idx entries, except those ;; xindy to ignore **all** TeX macros in .idx entries, except those
;; explicitely described in merge rule. But when after applying all ;; explicitly described in merge rule. But when after applying all
;; merge rules an empty string results, xindy raises an error: ;; merge rules an empty string results, xindy raises an error:
;; ERROR: CHAR: index 0 should be less than the length of the string ;; ERROR: CHAR: index 0 should be less than the length of the string
@ -31,7 +31,7 @@
;; scripts for the pdflatex engine. ;; scripts for the pdflatex engine.
;; Another issue caused by xindy ignoring all TeX macros except those ;; Another issue caused by xindy ignoring all TeX macros except those
;; explicitely declared reveals itself when attempting to index ">>>", ;; explicitly declared reveals itself when attempting to index ">>>",
;; as the ">" is converted to "\textgreater{}" by Sphinx's LaTeX ;; as the ">" is converted to "\textgreater{}" by Sphinx's LaTeX
;; escaping. ;; escaping.

View File

@ -10,7 +10,7 @@
\newcommand\sphinxsetlistlabels[5] \newcommand\sphinxsetlistlabels[5]
{% #1 = style, #2 = enum, #3 = enumnext, #4 = prefix, #5 = suffix {% #1 = style, #2 = enum, #3 = enumnext, #4 = prefix, #5 = suffix
% #2 and #3 are counters used by enumerate environement e.g. enumi, enumii. % #2 and #3 are counters used by enumerate environment e.g. enumi, enumii.
% #1 is a macro such as \arabic or \alph % #1 is a macro such as \arabic or \alph
% prefix and suffix are strings (by default empty and a dot). % prefix and suffix are strings (by default empty and a dot).
\@namedef{the#2}{#1{#2}}% \@namedef{the#2}{#1{#2}}%

View File

@ -21,13 +21,14 @@
{% block body %} {% block body %}
<h1 id="search-documentation">{{ _('Search') }}</h1> <h1 id="search-documentation">{{ _('Search') }}</h1>
{% block scriptwarning %} {% block scriptwarning %}
<div id="fallback" class="admonition warning"> <noscript>
<script>$('#fallback').hide();</script> <div class="admonition warning">
<p> <p>
{% trans %}Please activate JavaScript to enable the search {% trans %}Please activate JavaScript to enable the search
functionality.{% endtrans %} functionality.{% endtrans %}
</p> </p>
</div> </div>
</noscript>
{% endblock %} {% endblock %}
{% block searchtext %} {% block searchtext %}
<p> <p>

View File

@ -181,7 +181,7 @@ class AutoNumbering(SphinxTransform):
class SortIds(SphinxTransform): class SortIds(SphinxTransform):
""" """
Sort secion IDs so that the "id[0-9]+" one comes last. Sort section IDs so that the "id[0-9]+" one comes last.
""" """
default_priority = 261 default_priority = 261

View File

@ -178,7 +178,7 @@ class Locale(SphinxTransform):
# old_name entry still exists in nameids and # old_name entry still exists in nameids and
# nametypes for another duplicated entry. # nametypes for another duplicated entry.
# #
# * if _id is provided: bellow process # * if _id is provided: below process
if _id: if _id:
if not explicit: if not explicit:
# _id was not duplicated. # _id was not duplicated.

View File

@ -413,7 +413,7 @@ class SphinxRole:
class ReferenceRole(SphinxRole): class ReferenceRole(SphinxRole):
"""A base class for reference roles. """A base class for reference roles.
The reference roles can accpet ``link title <target>`` style as a text for The reference roles can accept ``link title <target>`` style as a text for
the role. The parsed result; link title and target will be stored to the role. The parsed result; link title and target will be stored to
``self.title`` and ``self.target``. ``self.title`` and ``self.target``.
""" """
@ -514,7 +514,7 @@ def new_document(source_path: str, settings: Any = None) -> nodes.document:
__document_cache__ = docutils.utils.new_document(source_path) __document_cache__ = docutils.utils.new_document(source_path)
if settings is None: if settings is None:
# Make a copy of ``settings`` from cache to accelerate instansiation # Make a copy of ``settings`` from cache to accelerate instantiation
settings = copy(__document_cache__.settings) settings = copy(__document_cache__.settings)
# Create a new instance of nodes.document using cached reporter # Create a new instance of nodes.document using cached reporter

View File

@ -129,7 +129,7 @@ def docname_to_domain(docname: str, compaction: Union[bool, str]) -> str:
return docname return docname
# date_format mappings: ustrftime() to bable.dates.format_datetime() # date_format mappings: ustrftime() to babel.dates.format_datetime()
date_format_mappings = { date_format_mappings = {
'%a': 'EEE', # Weekday as locales abbreviated name. '%a': 'EEE', # Weekday as locales abbreviated name.
'%A': 'EEEE', # Weekday as locales full name. '%A': 'EEEE', # Weekday as locales full name.

View File

@ -361,7 +361,7 @@ def educate_tokens(text_tokens: Iterable[Tuple[str, str]],
text = smartquotes.educateSingleBackticks(text, language) text = smartquotes.educateSingleBackticks(text, language)
if do_quotes: if do_quotes:
# Replace plain quotes to prevent converstion to # Replace plain quotes to prevent conversion to
# 2-character sequence in French. # 2-character sequence in French.
context = prev_token_last_char.replace('"', ';').replace("'", ';') context = prev_token_last_char.replace('"', ';').replace("'", ';')
text = educateQuotes(context + text, language)[1:] text = educateQuotes(context + text, language)[1:]

View File

@ -2,7 +2,7 @@
sphinx.util.typing sphinx.util.typing
~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~
The composit types for Sphinx. The composite types for Sphinx.
:copyright: Copyright 2007-2021 by the Sphinx team, see AUTHORS. :copyright: Copyright 2007-2021 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details. :license: BSD, see LICENSE for details.

View File

@ -1313,7 +1313,7 @@ class LaTeXTranslator(SphinxTranslator):
base, ext = path.splitext(uri) base, ext = path.splitext(uri)
if self.in_title and base: if self.in_title and base:
# Lowercase tokens forcely because some fncychap themes capitalize # Lowercase tokens forcely because some fncychap themes capitalize
# the options of \sphinxincludegraphics unexpectly (ex. WIDTH=...). # the options of \sphinxincludegraphics unexpectedly (ex. WIDTH=...).
self.body.append(r'\lowercase{\sphinxincludegraphics%s}{{%s}%s}' % self.body.append(r'\lowercase{\sphinxincludegraphics%s}{{%s}%s}' %
(options, base, ext)) (options, base, ext))
else: else:

View File

@ -6,7 +6,7 @@ SENTINEL = object()
def foo(name: str = CONSTANT, def foo(name: str = CONSTANT,
sentinal: Any = SENTINEL, sentinel: Any = SENTINEL,
now: datetime = datetime.now()) -> None: now: datetime = datetime.now()) -> None:
"""docstring""" """docstring"""
@ -14,6 +14,6 @@ def foo(name: str = CONSTANT,
class Class: class Class:
"""docstring""" """docstring"""
def meth(self, name: str = CONSTANT, sentinal: Any = SENTINEL, def meth(self, name: str = CONSTANT, sentinel: Any = SENTINEL,
now: datetime = datetime.now()) -> None: now: datetime = datetime.now()) -> None:
"""docstring""" """docstring"""

View File

@ -103,7 +103,7 @@ Javascript items
.. js:function:: bar.baz(href, callback[, errback]) .. js:function:: bar.baz(href, callback[, errback])
:param string href: The location of the resource. :param string href: The location of the resource.
:param callback: Get's called with the data returned by the resource. :param callback: Gets called with the data returned by the resource.
:throws InvalidHref: If the `href` is invalid. :throws InvalidHref: If the `href` is invalid.
:returns: `undefined` :returns: `undefined`

View File

@ -32,7 +32,7 @@ footnotes in table
:header-rows: 1 :header-rows: 1
* - name [#]_ * - name [#]_
- desription - description
* - VIDIOC_CROPCAP * - VIDIOC_CROPCAP
- Information about VIDIOC_CROPCAP [#]_ - Information about VIDIOC_CROPCAP [#]_

View File

@ -129,7 +129,7 @@ Javascript items
.. js:function:: bar.baz(href, callback[, errback]) .. js:function:: bar.baz(href, callback[, errback])
:param string href: The location of the resource. :param string href: The location of the resource.
:param callback: Get's called with the data returned by the resource. :param callback: Gets called with the data returned by the resource.
:throws InvalidHref: If the `href` is invalid. :throws InvalidHref: If the `href` is invalid.
:returns: `undefined` :returns: `undefined`

View File

@ -346,7 +346,7 @@ def test_epub_css_files(app):
content = (app.outdir / 'index.xhtml').read_text() content = (app.outdir / 'index.xhtml').read_text()
assert '<link rel="stylesheet" type="text/css" href="_static/css/epub.css" />' in content assert '<link rel="stylesheet" type="text/css" href="_static/css/epub.css" />' in content
# files in html_css_files are not outputed # files in html_css_files are not outputted
assert ('<link rel="stylesheet" type="text/css" href="_static/css/style.css" />' assert ('<link rel="stylesheet" type="text/css" href="_static/css/style.css" />'
not in content) not in content)
assert ('<link media="print" rel="stylesheet" title="title" type="text/css" ' assert ('<link media="print" rel="stylesheet" title="title" type="text/css" '

View File

@ -34,7 +34,7 @@ def test_event_allowed_exceptions():
events = EventManager(object()) # pass an dummy object as an app events = EventManager(object()) # pass an dummy object as an app
events.connect('builder-inited', raise_error, priority=500) events.connect('builder-inited', raise_error, priority=500)
# all errors are conveted to ExtensionError # all errors are converted to ExtensionError
with pytest.raises(ExtensionError): with pytest.raises(ExtensionError):
events.emit('builder-inited') events.emit('builder-inited')

View File

@ -825,7 +825,7 @@ def test_autodoc_typehints_description(app):
' Tuple[int, int]\n' ' Tuple[int, int]\n'
in context) in context)
# Overloads still get displyed in the signature # Overloads still get displayed in the signature
assert ('target.overload.sum(x: int, y: int = 0) -> int\n' assert ('target.overload.sum(x: int, y: int = 0) -> int\n'
'target.overload.sum(x: float, y: float = 0.0) -> float\n' 'target.overload.sum(x: float, y: float = 0.0) -> float\n'
'target.overload.sum(x: str, y: str = None) -> str\n' 'target.overload.sum(x: str, y: str = None) -> str\n'
@ -956,7 +956,7 @@ def test_autodoc_typehints_both(app):
' Tuple[int, int]\n' ' Tuple[int, int]\n'
in context) in context)
# Overloads still get displyed in the signature # Overloads still get displayed in the signature
assert ('target.overload.sum(x: int, y: int = 0) -> int\n' assert ('target.overload.sum(x: int, y: int = 0) -> int\n'
'target.overload.sum(x: float, y: float = 0.0) -> float\n' 'target.overload.sum(x: float, y: float = 0.0) -> float\n'
'target.overload.sum(x: str, y: str = None) -> str\n' 'target.overload.sum(x: str, y: str = None) -> str\n'

View File

@ -29,14 +29,14 @@ def test_preserve_defaults(app):
' docstring', ' docstring',
'', '',
'', '',
' .. py:method:: Class.meth(name: str = CONSTANT, sentinal: Any = SENTINEL, ' ' .. py:method:: Class.meth(name: str = CONSTANT, sentinel: Any = SENTINEL, '
'now: datetime.datetime = datetime.now()) -> None', 'now: datetime.datetime = datetime.now()) -> None',
' :module: target.preserve_defaults', ' :module: target.preserve_defaults',
'', '',
' docstring', ' docstring',
'', '',
'', '',
'.. py:function:: foo(name: str = CONSTANT, sentinal: Any = SENTINEL, now: ' '.. py:function:: foo(name: str = CONSTANT, sentinel: Any = SENTINEL, now: '
'datetime.datetime = datetime.now()) -> None', 'datetime.datetime = datetime.now()) -> None',
' :module: target.preserve_defaults', ' :module: target.preserve_defaults',
'', '',

View File

@ -224,7 +224,7 @@ def test_class():
'\n' '\n'
' def __init__(self):\n' ' def __init__(self):\n'
' self.a = 1 + 1 #: comment3\n' ' self.a = 1 + 1 #: comment3\n'
' self.attr2 = 1 + 1 #: overrided\n' ' self.attr2 = 1 + 1 #: overridden\n'
' b = 1 + 1 #: comment5\n' ' b = 1 + 1 #: comment5\n'
'\n' '\n'
' def some_method(self):\n' ' def some_method(self):\n'
@ -233,7 +233,7 @@ def test_class():
parser.parse() parser.parse()
assert parser.comments == {('Foo', 'attr1'): 'comment1', assert parser.comments == {('Foo', 'attr1'): 'comment1',
('Foo', 'a'): 'comment3', ('Foo', 'a'): 'comment3',
('Foo', 'attr2'): 'overrided'} ('Foo', 'attr2'): 'overridden'}
assert parser.definitions == {'Foo': ('class', 1, 11), assert parser.definitions == {'Foo': ('class', 1, 11),
'Foo.__init__': ('def', 5, 8), 'Foo.__init__': ('def', 5, 8),
'Foo.some_method': ('def', 10, 11)} 'Foo.some_method': ('def', 10, 11)}

View File

@ -26,7 +26,7 @@ def test_separate_metadata():
assert docstring == ':param baz:\n' assert docstring == ':param baz:\n'
assert metadata == {'foo': 'bar'} assert metadata == {'foo': 'bar'}
# field_list like text following just after paragaph is not a field_list # field_list like text following just after paragraph is not a field_list
text = ("blah blah blah\n" text = ("blah blah blah\n"
":meta foo: bar\n" ":meta foo: bar\n"
":meta baz:\n") ":meta baz:\n")

View File

@ -45,7 +45,7 @@ def test_SphinxFileOutput(tmpdir):
output.write(content) output.write(content)
os.utime(filename, (0, 0)) os.utime(filename, (0, 0))
# overrite it again # overwrite it again
output.write(content) output.write(content)
assert os.stat(filename).st_mtime != 0 # updated assert os.stat(filename).st_mtime != 0 # updated
@ -55,11 +55,11 @@ def test_SphinxFileOutput(tmpdir):
output.write(content) output.write(content)
os.utime(filename, (0, 0)) os.utime(filename, (0, 0))
# overrite it again # overwrite it again
output.write(content) output.write(content)
assert os.stat(filename).st_mtime == 0 # not updated assert os.stat(filename).st_mtime == 0 # not updated
# overrite it again (content changed) # overwrite it again (content changed)
output.write(content + "; content change") output.write(content + "; content change")
assert os.stat(filename).st_mtime != 0 # updated assert os.stat(filename).st_mtime != 0 # updated

View File

@ -272,7 +272,7 @@ def test_pending_warnings(app, status, warning):
logger.warning('message1') logger.warning('message1')
with logging.pending_warnings(): with logging.pending_warnings():
# not logged yet (bufferred) in here # not logged yet (buffered) in here
logger.warning('message2') logger.warning('message2')
logger.warning('message3') logger.warning('message3')
assert 'WARNING: message1' in warning.getvalue() assert 'WARNING: message1' in warning.getvalue()