Merge branch 'master' of github.com:sphinx-doc/sphinx

This commit is contained in:
Takeshi KOMIYA 2017-01-28 19:58:30 +09:00
commit d1b96871bf
2 changed files with 48 additions and 27 deletions

View File

@ -291,31 +291,12 @@ in the future.
The value of :confval:`master_doc`, for usage with :func:`pathto`. 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 .. data:: pagename
The "page name" of the current file, i.e. either the document name if the 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 file is generated from a reST source, or the equivalent hierarchical name
relative to the output directory (``[directory/]filename_without_extension``). 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 .. data:: project
The value of :confval:`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 automatically-generated files like the module index, or documents that already
are in HTML form), these variables are also available: 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 .. data:: meta
Document metadata (a dictionary), see :ref:`metadata`. 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 .. data:: sourcename
The name of the copied source file for the current document. This is only The name of the copied source file for the current document. This is only
nonempty if the :confval:`html_copy_source` value is ``True``. nonempty if the :confval:`html_copy_source` value is ``True``.
This has empty value on creating automatically-generated files. This has empty value on creating automatically-generated files.
.. data:: title
The page title.
.. data:: toc .. data:: toc
The local table of contents for the current page, rendered as HTML bullet 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 * ``includehidden`` (``False`` by default): if true, the TOC tree will also
contain hidden entries. 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.

View File

@ -143,13 +143,14 @@ class StandaloneHTMLBuilder(Builder):
def _get_translations_js(self): def _get_translations_js(self):
# type: () -> unicode # 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'), 'LC_MESSAGES', 'sphinx.js'),
path.join(sys.prefix, 'share/sphinx/locale', path.join(sys.prefix, 'share/sphinx/locale',
self.config.language, 'sphinx.js')] + \ self.config.language, 'sphinx.js')]
[path.join(dir, self.config.language,
'LC_MESSAGES', 'sphinx.js')
for dir in self.config.locale_dirs]
for jsfile in candidates: for jsfile in candidates:
if path.isfile(jsfile): if path.isfile(jsfile):
return jsfile return jsfile