mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Merge branch 'master' into master
This commit is contained in:
commit
e7ca01a965
1
CHANGES
1
CHANGES
@ -42,6 +42,7 @@ Features added
|
||||
imported members.
|
||||
* C++, add ``:tparam-line-spec:`` option to templated declarations.
|
||||
When specified, each template parameter will be rendered on a separate line.
|
||||
* #3359: Allow sphinx.js in a user locale dir to override sphinx.js from Sphinx
|
||||
* #3303: Add ``:pyversion:`` option to the doctest directive.
|
||||
|
||||
Bugs fixed
|
||||
|
@ -291,31 +291,12 @@ in the future.
|
||||
|
||||
The value of :confval:`master_doc`, for usage with :func:`pathto`.
|
||||
|
||||
.. data:: next
|
||||
|
||||
The next document for the navigation. This variable is either false or has
|
||||
two attributes `link` and `title`. The title contains HTML markup. For
|
||||
example, to generate a link to the next page, you can use this snippet::
|
||||
|
||||
{% if next %}
|
||||
<a href="{{ next.link|e }}">{{ next.title }}</a>
|
||||
{% endif %}
|
||||
|
||||
.. data:: pagename
|
||||
|
||||
The "page name" of the current file, i.e. either the document name if the
|
||||
file is generated from a reST source, or the equivalent hierarchical name
|
||||
relative to the output directory (``[directory/]filename_without_extension``).
|
||||
|
||||
.. data:: parents
|
||||
|
||||
A list of parent documents for navigation, structured like the :data:`next`
|
||||
item.
|
||||
|
||||
.. data:: prev
|
||||
|
||||
Like :data:`next`, but for the previous page.
|
||||
|
||||
.. data:: project
|
||||
|
||||
The value of :confval:`project`.
|
||||
@ -369,16 +350,58 @@ In documents that are created from source files (as opposed to
|
||||
automatically-generated files like the module index, or documents that already
|
||||
are in HTML form), these variables are also available:
|
||||
|
||||
.. data:: body
|
||||
|
||||
A string containing the content of the page in HTML form as produced by the HTML builder,
|
||||
before the theme is applied.
|
||||
|
||||
.. data:: display_toc
|
||||
|
||||
A boolean that is True if the toc contains more than one entry.
|
||||
|
||||
.. data:: meta
|
||||
|
||||
Document metadata (a dictionary), see :ref:`metadata`.
|
||||
|
||||
.. data:: metatags
|
||||
|
||||
A string containing the page's HTML :dudir:`meta` tags.
|
||||
|
||||
.. data:: next
|
||||
|
||||
The next document for the navigation. This variable is either false or has
|
||||
two attributes `link` and `title`. The title contains HTML markup. For
|
||||
example, to generate a link to the next page, you can use this snippet::
|
||||
|
||||
{% if next %}
|
||||
<a href="{{ next.link|e }}">{{ next.title }}</a>
|
||||
{% endif %}
|
||||
|
||||
|
||||
.. data:: page_source_suffix
|
||||
|
||||
The suffix of the file that was rendered. Since we support a list of :confval:`source_suffix`,
|
||||
this will allow you to properly link to the original source file.
|
||||
|
||||
.. data:: parents
|
||||
|
||||
A list of parent documents for navigation, structured like the :data:`next`
|
||||
item.
|
||||
|
||||
.. data:: prev
|
||||
|
||||
Like :data:`next`, but for the previous page.
|
||||
|
||||
.. data:: sourcename
|
||||
|
||||
The name of the copied source file for the current document. This is only
|
||||
nonempty if the :confval:`html_copy_source` value is ``True``.
|
||||
This has empty value on creating automatically-generated files.
|
||||
|
||||
.. data:: title
|
||||
|
||||
The page title.
|
||||
|
||||
.. data:: toc
|
||||
|
||||
The local table of contents for the current page, rendered as HTML bullet
|
||||
@ -401,7 +424,4 @@ are in HTML form), these variables are also available:
|
||||
* ``includehidden`` (``False`` by default): if true, the TOC tree will also
|
||||
contain hidden entries.
|
||||
|
||||
.. data:: page_source_suffix
|
||||
|
||||
The suffix of the file that was rendered. Since we support a list of :confval:`source_suffix`,
|
||||
this will allow you to properly link to the original source file.
|
||||
|
@ -569,7 +569,7 @@ class EpubBuilder(StandaloneHTMLBuilder):
|
||||
f.write(self.container_template) # type: ignore
|
||||
|
||||
def content_metadata(self, files, spine, guide):
|
||||
# type: (List[unicode], Any, Any) -> Dict[unicode, Any]
|
||||
# type: (List[unicode], List[unicode], List[unicode]) -> Dict[unicode, Any]
|
||||
"""Create a dictionary with all metadata for the content.opf
|
||||
file properly escaped.
|
||||
"""
|
||||
|
@ -143,13 +143,14 @@ class StandaloneHTMLBuilder(Builder):
|
||||
|
||||
def _get_translations_js(self):
|
||||
# type: () -> unicode
|
||||
candidates = [path.join(package_dir, 'locale', self.config.language,
|
||||
candidates = [path.join(dir, self.config.language,
|
||||
'LC_MESSAGES', 'sphinx.js')
|
||||
for dir in self.config.locale_dirs] + \
|
||||
[path.join(package_dir, 'locale', self.config.language,
|
||||
'LC_MESSAGES', 'sphinx.js'),
|
||||
path.join(sys.prefix, 'share/sphinx/locale',
|
||||
self.config.language, 'sphinx.js')] + \
|
||||
[path.join(dir, self.config.language,
|
||||
'LC_MESSAGES', 'sphinx.js')
|
||||
for dir in self.config.locale_dirs]
|
||||
self.config.language, 'sphinx.js')]
|
||||
|
||||
for jsfile in candidates:
|
||||
if path.isfile(jsfile):
|
||||
return jsfile
|
||||
|
Loading…
Reference in New Issue
Block a user