mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Fix line numbers were not show on warnings of numfigs
This commit is contained in:
parent
4c8b575dcc
commit
7898c64cf4
1
CHANGES
1
CHANGES
@ -6,6 +6,7 @@ Bugs fixed
|
|||||||
|
|
||||||
* Fix line numbers was not shown on warnings in LaTeX and texinfo builders
|
* Fix line numbers was not shown on warnings in LaTeX and texinfo builders
|
||||||
* Fix filenames were not shown on warnings of citations
|
* Fix filenames were not shown on warnings of citations
|
||||||
|
* Fix line numbers was not shown on warnings in LaTeX and texinfo builders
|
||||||
|
|
||||||
Release 1.3.4 (released Jan 12, 2016)
|
Release 1.3.4 (released Jan 12, 2016)
|
||||||
=====================================
|
=====================================
|
||||||
|
@ -628,7 +628,8 @@ class StandardDomain(Domain):
|
|||||||
return None
|
return None
|
||||||
|
|
||||||
if env.config.numfig is False:
|
if env.config.numfig is False:
|
||||||
env.warn(fromdocname, 'numfig is disabled. :numref: is ignored.')
|
env.warn(fromdocname, 'numfig is disabled. :numref: is ignored.',
|
||||||
|
lineno=node.line)
|
||||||
return contnode
|
return contnode
|
||||||
|
|
||||||
try:
|
try:
|
||||||
@ -646,7 +647,8 @@ class StandardDomain(Domain):
|
|||||||
try:
|
try:
|
||||||
newtitle = title % '.'.join(map(str, fignumber))
|
newtitle = title % '.'.join(map(str, fignumber))
|
||||||
except TypeError:
|
except TypeError:
|
||||||
env.warn(fromdocname, 'invalid numfig_format: %s' % title)
|
env.warn(fromdocname, 'invalid numfig_format: %s' % title,
|
||||||
|
lineno=node.line)
|
||||||
return None
|
return None
|
||||||
|
|
||||||
return self.build_reference_node(fromdocname, builder,
|
return self.build_reference_node(fromdocname, builder,
|
||||||
|
@ -495,8 +495,10 @@ def test_tocdepth_singlehtml(app, status, warning):
|
|||||||
def test_numfig_disabled(app, status, warning):
|
def test_numfig_disabled(app, status, warning):
|
||||||
app.builder.build_all()
|
app.builder.build_all()
|
||||||
|
|
||||||
assert 'WARNING: invalid numfig_format: invalid' not in warning.getvalue()
|
assert ('index.rst:45: WARNING: numfig is disabled. :numref: is ignored.'
|
||||||
assert 'WARNING: invalid numfig_format: Fig %s %s' not in warning.getvalue()
|
in warning.getvalue())
|
||||||
|
assert 'index.rst:51: WARNING: invalid numfig_format: invalid' not in warning.getvalue()
|
||||||
|
assert 'index.rst:52: WARNING: invalid numfig_format: Fig %s %s' not in warning.getvalue()
|
||||||
|
|
||||||
expects = {
|
expects = {
|
||||||
'index.html': [
|
'index.html': [
|
||||||
@ -554,8 +556,10 @@ def test_numfig_without_numbered_toctree(app, status, warning):
|
|||||||
(app.srcdir / 'index.rst').write_text(index, encoding='utf-8')
|
(app.srcdir / 'index.rst').write_text(index, encoding='utf-8')
|
||||||
app.builder.build_all()
|
app.builder.build_all()
|
||||||
|
|
||||||
assert 'WARNING: invalid numfig_format: invalid' in warning.getvalue()
|
assert ('index.rst:45: WARNING: numfig is disabled. :numref: is ignored.'
|
||||||
assert 'WARNING: invalid numfig_format: Fig %s %s' in warning.getvalue()
|
not in warning.getvalue())
|
||||||
|
assert 'index.rst:51: WARNING: invalid numfig_format: invalid' in warning.getvalue()
|
||||||
|
assert 'index.rst:52: WARNING: invalid numfig_format: Fig %s %s' in warning.getvalue()
|
||||||
|
|
||||||
expects = {
|
expects = {
|
||||||
'index.html': [
|
'index.html': [
|
||||||
@ -649,8 +653,10 @@ def test_numfig_without_numbered_toctree(app, status, warning):
|
|||||||
def test_numfig_with_numbered_toctree(app, status, warning):
|
def test_numfig_with_numbered_toctree(app, status, warning):
|
||||||
app.builder.build_all()
|
app.builder.build_all()
|
||||||
|
|
||||||
assert 'WARNING: invalid numfig_format: invalid' in warning.getvalue()
|
assert ('index.rst:45: WARNING: numfig is disabled. :numref: is ignored.'
|
||||||
assert 'WARNING: invalid numfig_format: Fig %s %s' in warning.getvalue()
|
not in warning.getvalue())
|
||||||
|
assert 'index.rst:51: WARNING: invalid numfig_format: invalid' in warning.getvalue()
|
||||||
|
assert 'index.rst:52: WARNING: invalid numfig_format: Fig %s %s' in warning.getvalue()
|
||||||
|
|
||||||
expects = {
|
expects = {
|
||||||
'index.html': [
|
'index.html': [
|
||||||
@ -747,8 +753,10 @@ def test_numfig_with_numbered_toctree(app, status, warning):
|
|||||||
def test_numfig_with_prefix(app, status, warning):
|
def test_numfig_with_prefix(app, status, warning):
|
||||||
app.builder.build_all()
|
app.builder.build_all()
|
||||||
|
|
||||||
assert 'WARNING: invalid numfig_format: invalid' in warning.getvalue()
|
assert ('index.rst:45: WARNING: numfig is disabled. :numref: is ignored.'
|
||||||
assert 'WARNING: invalid numfig_format: Fig %s %s' in warning.getvalue()
|
not in warning.getvalue())
|
||||||
|
assert 'index.rst:51: WARNING: invalid numfig_format: invalid' in warning.getvalue()
|
||||||
|
assert 'index.rst:52: WARNING: invalid numfig_format: Fig %s %s' in warning.getvalue()
|
||||||
|
|
||||||
expects = {
|
expects = {
|
||||||
'index.html': [
|
'index.html': [
|
||||||
@ -842,8 +850,10 @@ def test_numfig_with_prefix(app, status, warning):
|
|||||||
def test_numfig_with_secnum_depth(app, status, warning):
|
def test_numfig_with_secnum_depth(app, status, warning):
|
||||||
app.builder.build_all()
|
app.builder.build_all()
|
||||||
|
|
||||||
assert 'WARNING: invalid numfig_format: invalid' in warning.getvalue()
|
assert ('index.rst:45: WARNING: numfig is disabled. :numref: is ignored.'
|
||||||
assert 'WARNING: invalid numfig_format: Fig %s %s' in warning.getvalue()
|
not in warning.getvalue())
|
||||||
|
assert 'index.rst:51: WARNING: invalid numfig_format: invalid' in warning.getvalue()
|
||||||
|
assert 'index.rst:52: WARNING: invalid numfig_format: Fig %s %s' in warning.getvalue()
|
||||||
|
|
||||||
expects = {
|
expects = {
|
||||||
'index.html': [
|
'index.html': [
|
||||||
|
Loading…
Reference in New Issue
Block a user