Commit 10fb2713 authored by Ralf Schmitt's avatar Ralf Schmitt

mysphinxext.py: add support for newer versions of sphinx.

 this is a patch by Oerjan Persson from the gevent debian package. Thanks.
parent 8ff6a61e
...@@ -18,6 +18,10 @@ def missing_reference(app, env, node, contnode): ...@@ -18,6 +18,10 @@ def missing_reference(app, env, node, contnode):
type = node['reftype'] type = node['reftype']
target = node['reftarget'] target = node['reftarget']
if node.has_key('py:module'):
modname = node['py:module']
classname = node['py:class']
else:
modname = node['modname'] modname = node['modname']
classname = node['classname'] classname = node['classname']
...@@ -28,7 +32,8 @@ def missing_reference(app, env, node, contnode): ...@@ -28,7 +32,8 @@ def missing_reference(app, env, node, contnode):
newnode = nodes.reference('', '') newnode = nodes.reference('', '')
newnode['refuri'] = refuri newnode['refuri'] = refuri
newnode['reftitle'] = reftitle newnode['reftitle'] = reftitle
newnode['class'] = 'external-xref' newnode['py:class'] = 'external-xref'
newnode['classname'] = 'external-xref'
newnode.append(contnode) newnode.append(contnode)
msg = 'Resolved missing-reference: :%5s:`%s` -> %s' % (type, target, refuri) msg = 'Resolved missing-reference: :%5s:`%s` -> %s' % (type, target, refuri)
if noisy >= 1 or msg not in message_cache: if noisy >= 1 or msg not in message_cache:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment