diff options
| author | Georg Brandl <georg@python.org> | 2012-10-28 18:21:57 +0100 |
|---|---|---|
| committer | Georg Brandl <georg@python.org> | 2012-10-28 18:21:57 +0100 |
| commit | bda6110fe0420798fe20adb2e3110afcff8be187 (patch) | |
| tree | 962a3f649bcebc3d8f5c6a97b6ffa9ffab21d41f /tests/root | |
| parent | dca15200c3185ad18b42f771c6f2431e5bfa162e (diff) | |
| parent | bb8d2307d28803acab6f1d3aab7e83dcd0d114b9 (diff) | |
| download | sphinx-bda6110fe0420798fe20adb2e3110afcff8be187.tar.gz | |
Merged in pv/sphinx-work/ext-linkcode (pull request #47)
Diffstat (limited to 'tests/root')
| -rw-r--r-- | tests/root/conf.py | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/root/conf.py b/tests/root/conf.py index b97ddfcc..37d5e91a 100644 --- a/tests/root/conf.py +++ b/tests/root/conf.py @@ -67,6 +67,28 @@ extlinks = {'issue': ('http://bugs.python.org/issue%s', 'issue '), # modify tags from conf.py tags.add('confpytag') +# -- linkcode + +if 'test_linkcode' in tags: + import glob + + extensions.remove('sphinx.ext.viewcode') + extensions.append('sphinx.ext.linkcode') + + exclude_patterns.extend(glob.glob('*.txt') + glob.glob('*/*.txt')) + exclude_patterns.remove('contents.txt') + exclude_patterns.remove('objects.txt') + + def linkcode_resolve(domain, info): + if domain == 'py': + fn = info['module'].replace('.', '/') + return "http://foobar/source/%s.py" % fn + elif domain == "js": + return "http://foobar/js/" + info['fullname'] + elif domain in ("c", "cpp"): + return "http://foobar/%s/%s" % (domain, "".join(info['names'])) + else: + raise AssertionError() # -- extension API |
