mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Merge branch 'stable' into 1086bfa6-fa4c-485f-bd17-6aa1ca49f851
This commit is contained in:
commit
cd4964249f
2
CHANGES
2
CHANGES
@ -31,6 +31,8 @@ Bugs fixed
|
|||||||
* #3692: Unable to build HTML if writing .buildinfo failed
|
* #3692: Unable to build HTML if writing .buildinfo failed
|
||||||
* #4152: HTML writer crashes if a field list is placed on top of the document
|
* #4152: HTML writer crashes if a field list is placed on top of the document
|
||||||
* #4063: Sphinx crashes when labeling directive ``.. todolist::``
|
* #4063: Sphinx crashes when labeling directive ``.. todolist::``
|
||||||
|
* #4134: [doc] :file:`docutils.conf` is not documented explicitly
|
||||||
|
* #4169: Chinese language doesn't trigger Chinese search automatically
|
||||||
* #1020: ext.todo todolist not linking to the page in pdflatex
|
* #1020: ext.todo todolist not linking to the page in pdflatex
|
||||||
|
|
||||||
Testing
|
Testing
|
||||||
|
@ -9,8 +9,20 @@ The build configuration file
|
|||||||
:synopsis: Build configuration file.
|
:synopsis: Build configuration file.
|
||||||
|
|
||||||
The :term:`configuration directory` must contain a file named :file:`conf.py`.
|
The :term:`configuration directory` must contain a file named :file:`conf.py`.
|
||||||
This file (containing Python code) is called the "build configuration file" and
|
This file (containing Python code) is called the "build configuration file"
|
||||||
contains all configuration needed to customize Sphinx input and output behavior.
|
and contains (almost) all configuration needed to customize Sphinx input
|
||||||
|
and output behavior.
|
||||||
|
|
||||||
|
An optional file `docutils.conf`_ can be added to the configuration
|
||||||
|
directory to adjust `Docutils`_ configuration if not otherwise overriden or
|
||||||
|
set by Sphinx; this applies in particular to the `Docutils smart_quotes
|
||||||
|
setting`_ (Note that Sphinx applies smart quotes transform by default.)
|
||||||
|
|
||||||
|
.. _`docutils`: http://docutils.sourceforge.net/
|
||||||
|
|
||||||
|
.. _`docutils.conf`: http://docutils.sourceforge.net/docs/user/config.html
|
||||||
|
|
||||||
|
.. _`Docutils smart_quotes setting`: http://docutils.sourceforge.net/docs/user/config.html#smart-quotes
|
||||||
|
|
||||||
The configuration file is executed as Python code at build time (using
|
The configuration file is executed as Python code at build time (using
|
||||||
:func:`execfile`, and with the current directory set to its containing
|
:func:`execfile`, and with the current directory set to its containing
|
||||||
@ -769,8 +781,8 @@ that use Sphinx's HTMLWriter class.
|
|||||||
entities. Default: ``True``.
|
entities. Default: ``True``.
|
||||||
|
|
||||||
.. deprecated:: 1.6
|
.. deprecated:: 1.6
|
||||||
Use the `smart_quotes option`_ in the Docutils configuration file
|
To disable or customize smart quotes, use the Docutils configuration file
|
||||||
(``docutils.conf``) instead.
|
(``docutils.conf``) instead to set there its `smart_quotes option`_.
|
||||||
|
|
||||||
.. _`smart_quotes option`: http://docutils.sourceforge.net/docs/user/config.html#smart-quotes
|
.. _`smart_quotes option`: http://docutils.sourceforge.net/docs/user/config.html#smart-quotes
|
||||||
|
|
||||||
|
@ -217,7 +217,7 @@ def load_mappings(app):
|
|||||||
|
|
||||||
if isinstance(value, (list, tuple)):
|
if isinstance(value, (list, tuple)):
|
||||||
# new format
|
# new format
|
||||||
name, (uri, inv) = key, value # type: ignore
|
name, (uri, inv) = key, value
|
||||||
if not isinstance(name, string_types):
|
if not isinstance(name, string_types):
|
||||||
logger.warning('intersphinx identifier %r is not string. Ignored', name)
|
logger.warning('intersphinx identifier %r is not string. Ignored', name)
|
||||||
continue
|
continue
|
||||||
|
@ -265,6 +265,11 @@ class IndexBuilder(object):
|
|||||||
# objtype index -> (domain, type, objname (localized))
|
# objtype index -> (domain, type, objname (localized))
|
||||||
lang_class = languages.get(lang) # type: Type[SearchLanguage]
|
lang_class = languages.get(lang) # type: Type[SearchLanguage]
|
||||||
# add language-specific SearchLanguage instance
|
# add language-specific SearchLanguage instance
|
||||||
|
|
||||||
|
# fallback; try again with language-code
|
||||||
|
if lang_class is None and '_' in lang:
|
||||||
|
lang_class = languages.get(lang.split('_')[0])
|
||||||
|
|
||||||
if lang_class is None:
|
if lang_class is None:
|
||||||
self.lang = SearchEnglish(options) # type: SearchLanguage
|
self.lang = SearchEnglish(options) # type: SearchLanguage
|
||||||
elif isinstance(lang_class, str):
|
elif isinstance(lang_class, str):
|
||||||
|
@ -228,3 +228,15 @@ def test_IndexBuilder():
|
|||||||
}
|
}
|
||||||
assert index._objtypes == {('dummy', 'objtype'): 0}
|
assert index._objtypes == {('dummy', 'objtype'): 0}
|
||||||
assert index._objnames == {0: ('dummy', 'objtype', 'objtype')}
|
assert index._objnames == {0: ('dummy', 'objtype', 'objtype')}
|
||||||
|
|
||||||
|
|
||||||
|
def test_IndexBuilder_lookup():
|
||||||
|
env = DummyEnvironment('1.0', {})
|
||||||
|
|
||||||
|
# zh
|
||||||
|
index = IndexBuilder(env, 'zh', {}, None)
|
||||||
|
assert index.lang.lang == 'zh'
|
||||||
|
|
||||||
|
# zh_CN
|
||||||
|
index = IndexBuilder(env, 'zh_CN', {}, None)
|
||||||
|
assert index.lang.lang == 'zh'
|
||||||
|
Loading…
Reference in New Issue
Block a user