Merge branch '1.7' into 4716_make_not_found

This commit is contained in:
Takeshi KOMIYA
2018-03-08 20:40:34 +09:00
committed by GitHub
4 changed files with 9 additions and 9 deletions

View File

@@ -22,6 +22,7 @@ Bugs fixed
* pydomain: always strip parenthesis if empty (refs: #1042) * pydomain: always strip parenthesis if empty (refs: #1042)
* #4689: autosummary: unexpectedly strips docstrings containing "i.e." * #4689: autosummary: unexpectedly strips docstrings containing "i.e."
* #4701: viewcode: Misplaced ``<div>`` in viewcode html output * #4701: viewcode: Misplaced ``<div>`` in viewcode html output
* #4444: Don't require numfig to use :numref: on sections
* #4716: Generation PDF file with TexLive on Windows, file not found error * #4716: Generation PDF file with TexLive on Windows, file not found error
Testing Testing

View File

@@ -715,15 +715,15 @@ class StandardDomain(Domain):
if not docname: if not docname:
return None return None
if env.config.numfig is False:
logger.warning('numfig is disabled. :numref: is ignored.', location=node)
return contnode
target_node = env.get_doctree(docname).ids.get(labelid) target_node = env.get_doctree(docname).ids.get(labelid)
figtype = self.get_figtype(target_node) figtype = self.get_figtype(target_node)
if figtype is None: if figtype is None:
return None return None
if figtype != 'section' and env.config.numfig is False:
logger.warning('numfig is disabled. :numref: is ignored.', location=node)
return contnode
try: try:
fignumber = self.get_fignumber(env, builder, figtype, docname, target_node) fignumber = self.get_fignumber(env, builder, figtype, docname, target_node)
if fignumber is None: if fignumber is None:

View File

@@ -267,7 +267,7 @@ def test_run_epubcheck(app):
epubcheck = os.environ.get('EPUBCHECK_PATH', '/usr/share/java/epubcheck.jar') epubcheck = os.environ.get('EPUBCHECK_PATH', '/usr/share/java/epubcheck.jar')
if runnable('java') and os.path.exists(epubcheck): if runnable('java') and os.path.exists(epubcheck):
p = Popen(['java', '-jar', epubcheck, app.outdir / 'Sphinx.epub'], p = Popen(['java', '-jar', epubcheck, app.outdir / 'SphinxTests.epub'],
stdout=PIPE, stderr=PIPE) stdout=PIPE, stderr=PIPE)
stdout, stderr = p.communicate() stdout, stderr = p.communicate()
if p.returncode != 0: if p.returncode != 0:

View File

@@ -507,7 +507,6 @@ def test_numfig_disabled_warn(app, warning):
app.build() app.build()
warnings = warning.getvalue() warnings = warning.getvalue()
assert 'index.rst:47: WARNING: numfig is disabled. :numref: is ignored.' in warnings assert 'index.rst:47: WARNING: numfig is disabled. :numref: is ignored.' in warnings
assert 'index.rst:55: WARNING: no number is assigned for section: index' not in warnings
assert 'index.rst:56: WARNING: invalid numfig_format: invalid' not in warnings assert 'index.rst:56: WARNING: invalid numfig_format: invalid' not in warnings
assert 'index.rst:57: WARNING: invalid numfig_format: Fig %s %s' not in warnings assert 'index.rst:57: WARNING: invalid numfig_format: Fig %s %s' not in warnings
@@ -525,10 +524,10 @@ def test_numfig_disabled_warn(app, warning):
(".//li/code/span", '^Table:%s$', True), (".//li/code/span", '^Table:%s$', True),
(".//li/code/span", '^CODE_1$', True), (".//li/code/span", '^CODE_1$', True),
(".//li/code/span", '^Code-%s$', True), (".//li/code/span", '^Code-%s$', True),
(".//li/code/span", '^foo$', True), (".//li/a/span", '^Section 1$', True),
(".//li/code/span", '^bar_a$', True), (".//li/a/span", '^Section 2.1$', True),
(".//li/code/span", '^Fig.{number}$', True), (".//li/code/span", '^Fig.{number}$', True),
(".//li/code/span", '^Sect.{number}$', True), (".//li/a/span", '^Sect.1 Foo$', True),
], ],
'foo.html': [ 'foo.html': [
(".//div[@class='figure']/p[@class='caption']/" (".//div[@class='figure']/p[@class='caption']/"