Add a minimal test for external toctree links and fix a small bug found by it.

This commit is contained in:
Georg Brandl
2009-01-26 22:04:29 +01:00
parent e974741c74
commit f1e39097c6
3 changed files with 6 additions and 2 deletions

View File

@@ -1005,8 +1005,9 @@ class BuildEnvironment:
_walk_depth(newnode, 1, prune and maxdepth or 0)
# set the target paths in the toctrees (they are not known at TOC generation time)
for refnode in newnode.traverse(nodes.reference):
refnode['refuri'] = builder.get_relative_uri(
docname, refnode['refuri']) + refnode['anchorname']
if not refnode['refuri'].startswith('http://'): # FIXME: see above
refnode['refuri'] = builder.get_relative_uri(
docname, refnode['refuri']) + refnode['anchorname']
return newnode
descroles = frozenset(('data', 'exc', 'func', 'class', 'const', 'attr', 'obj',

View File

@@ -18,6 +18,8 @@ Contents:
math
autodoc
Python <http://python.org/>
Indices and tables
==================

View File

@@ -95,6 +95,7 @@ HTML_XPATH = {
".//li[@class='toctree-l2']/a": 'Admonitions',
".//title": 'Sphinx <Tests>',
".//div[@class='footer']": 'Georg Brandl & Team',
".//a[@href='http://python.org/']": '',
},
}