mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2026-10-03 04:06:54 -05:00
#241: Fix a crash building LaTeX output for documents that contain
a todolist directive.
This commit is contained in:
1 parent
3276bb42c8
commit
456abdefbe
2 files changed
+11
-3
No files matched your search
@@ -1,6 +1,9 @@
|
|||||||
Release 0.6.3 (in development)
|
Release 0.6.3 (in development)
|
||||||
==============================
|
==============================
|
||||||
|
|
||||||
|
* #241: Fix a crash building LaTeX output for documents that contain
|
||||||
|
a todolist directive.
|
||||||
|
|
||||||
* #252: Make it easier to change the build dir in the Makefiles
|
* #252: Make it easier to change the build dir in the Makefiles
|
||||||
generated by quickstart.
|
generated by quickstart.
|
||||||
|
|
||||||
|
|||||||
+8
-3
@@ -14,6 +14,7 @@
|
|||||||
|
|
||||||
from docutils import nodes
|
from docutils import nodes
|
||||||
|
|
||||||
|
from sphinx.environment import NoUri
|
||||||
from sphinx.util.compat import Directive, make_admonition
|
from sphinx.util.compat import Directive, make_admonition
|
||||||
|
|
||||||
class todo_node(nodes.Admonition, nodes.Element): pass
|
class todo_node(nodes.Admonition, nodes.Element): pass
|
||||||
@@ -104,9 +105,13 @@ def process_todo_nodes(app, doctree, fromdocname):
|
|||||||
newnode = nodes.reference('', '')
|
newnode = nodes.reference('', '')
|
||||||
innernode = nodes.emphasis(_('here'), _('here'))
|
innernode = nodes.emphasis(_('here'), _('here'))
|
||||||
newnode['refdocname'] = todo_info['docname']
|
newnode['refdocname'] = todo_info['docname']
|
||||||
newnode['refuri'] = app.builder.get_relative_uri(
|
try:
|
||||||
fromdocname, todo_info['docname'])
|
newnode['refuri'] = app.builder.get_relative_uri(
|
||||||
newnode['refuri'] += '#' + todo_info['target']['refid']
|
fromdocname, todo_info['docname'])
|
||||||
|
newnode['refuri'] += '#' + todo_info['target']['refid']
|
||||||
|
except NoUri:
|
||||||
|
# ignore if no URI can be determined, e.g. for LaTeX output
|
||||||
|
pass
|
||||||
newnode.append(innernode)
|
newnode.append(innernode)
|
||||||
para += newnode
|
para += newnode
|
||||||
para += nodes.Text('.)', '.)')
|
para += nodes.Text('.)', '.)')
|
||||||
|
|||||||
Reference in new issue
Block a user