Merge branch 'stable'

This commit is contained in:
jfbu 2017-03-03 09:53:50 +01:00
commit fb5dd840f4
5 changed files with 25 additions and 7 deletions

View File

@ -139,6 +139,9 @@ Bugs fixed
except first time build
* #3488: objects.inv has broken when ``release`` or ``version`` contain
return code
* #2073, #3443, #3490: gettext builder that writes pot files unless the content
are same without creation date. Thanks to Yoshiki Shibukawa.
* #3487: intersphinx: failed to refer options
Testing
--------

View File

@ -944,9 +944,10 @@ that use Sphinx's HTMLWriter class.
.. confval:: html_compact_lists
If true, list items containing only a single paragraph will not be rendered
with a ``<p>`` element. This is standard docutils behavior. Default:
``True``.
If true, a list all whose items consist of a single paragraph and/or a
sub-list all whose items etc... (recursive definition) will not use the
``<p>`` element for any of its items. This is standard docutils behavior.
Default: ``True``.
.. versionadded:: 1.0

View File

@ -18,7 +18,7 @@ from datetime import datetime, tzinfo, timedelta
from collections import defaultdict
from uuid import uuid4
from six import iteritems
from six import iteritems, StringIO
from sphinx.builders import Builder
from sphinx.util import split_index_msg, logging, status_iterator
@ -192,6 +192,20 @@ class LocalTimeZone(tzinfo):
ltz = LocalTimeZone()
def should_write(filepath, new_content):
if not path.exists(filepath):
return True
with open(filepath, 'r', encoding='utf-8') as oldpot:
old_content = oldpot.read()
old_header_index = old_content.index('"POT-Creation-Date:')
new_header_index = old_content.index('"POT-Creation-Date:')
old_body_index = old_content.index('"PO-Revision-Date:')
new_body_index = new_content.index('"PO-Revision-Date:')
return ((old_content[:old_header_index] != new_content[:new_header_index]) or
(new_content[new_body_index:] != old_content[old_body_index:]))
return True
class MessageCatalogBuilder(I18nBuilder):
"""
Builds gettext-style message catalogs (.pot files).

View File

@ -856,7 +856,7 @@ class StandardDomain(Domain):
for doc in self.env.all_docs:
yield (doc, clean_astext(self.env.titles[doc]), 'doc', doc, '', -1)
for (prog, option), info in iteritems(self.data['progoptions']):
yield (option, option, 'option', info[0], info[1], 1)
yield (option, option, 'cmdoption', info[0], info[1], 1)
for (type, name), info in iteritems(self.data['objects']):
yield (name, name, type, info[0], info[1],
self.object_types[type].attrs['searchprio'])

View File

@ -15,13 +15,13 @@
\endfirsthead
\multicolumn{<%= table.colcount %>}{c}%
{{\sphinxtablecontinued{\tablename\ \thetable{} -- <%= _('continued from previous page') %>}}} \\
{\makebox[0pt]{\sphinxtablecontinued{\tablename\ \thetable{} -- <%= _('continued from previous page') %>}}}\\
\hline
<%= ''.join(table.header) %>
\endhead
\hline
\multicolumn{<%= table.colcount %>}{|r|}{{\sphinxtablecontinued{<%= _('Continued on next page') %>}}} \\
\multicolumn{<%= table.colcount %>}{|r|}{\makebox[0pt][r]{\sphinxtablecontinued{<%= _('Continued on next page') %>}}}\\
\hline
\endfoot