[Python-checkins] r57149 - doctools/trunk/sphinx/roles.py
georg.brandl
python-checkins at python.org
Fri Aug 17 18:55:48 CEST 2007
Author: georg.brandl
Date: Fri Aug 17 18:55:09 2007
New Revision: 57149
Modified:
doctools/trunk/sphinx/roles.py
Log:
Add ``!`` x-ref feature.
Modified: doctools/trunk/sphinx/roles.py
==============================================================================
--- doctools/trunk/sphinx/roles.py (original)
+++ doctools/trunk/sphinx/roles.py Fri Aug 17 18:55:09 2007
@@ -99,6 +99,11 @@
if typ in ('func', 'meth', 'cfunc') and \
env.config.get('add_function_parentheses', True):
text += '()'
+ # if the first character is a bang, don't cross-reference at all
+ if text[0:1] == '!':
+ text = text[1:]
+ return [innernodetypes.get(typ, nodes.literal)(
+ rawtext, text, classes=['xref'])], []
pnode = addnodes.pending_xref(rawtext)
pnode['reftype'] = typ
# if the first character is a dot, search more specific namespaces first
More information about the Python-checkins
mailing list