mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Merge branch '1.7' into 4716_make_not_found
This commit is contained in:
1
CHANGES
1
CHANGES
@@ -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
|
||||||
|
|||||||
@@ -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:
|
||||||
|
|||||||
@@ -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:
|
||||||
|
|||||||
@@ -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']/"
|
||||||
|
|||||||
Reference in New Issue
Block a user