mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Fix #616: Allow keywords to be linked via intersphinx.
This commit is contained in:
2
CHANGES
2
CHANGES
@@ -1,6 +1,8 @@
|
||||
Release 1.0.8 (Sep 22, 2011)
|
||||
============================
|
||||
|
||||
* #616: Allow keywords to be linked via intersphinx.
|
||||
|
||||
* #613: Allow Unicode characters in production list token names.
|
||||
|
||||
* #720: Add dummy visitors for graphviz nodes for text and man.
|
||||
|
||||
@@ -328,7 +328,8 @@ class StandardDomain(Domain):
|
||||
object_types = {
|
||||
'term': ObjType(l_('glossary term'), 'term', searchprio=-1),
|
||||
'token': ObjType(l_('grammar token'), 'token', searchprio=-1),
|
||||
'label': ObjType(l_('reference label'), 'ref', searchprio=-1),
|
||||
'label': ObjType(l_('reference label'), 'ref', 'keyword',
|
||||
searchprio=-1),
|
||||
'envvar': ObjType(l_('environment variable'), 'envvar'),
|
||||
'cmdoption': ObjType(l_('program option'), 'option'),
|
||||
}
|
||||
|
||||
@@ -32,6 +32,7 @@ from os import path
|
||||
|
||||
from docutils import nodes
|
||||
|
||||
from sphinx.locale import _
|
||||
from sphinx.builders.html import INVENTORY_FILENAME
|
||||
|
||||
handlers = [urllib2.ProxyHandler(), urllib2.HTTPRedirectHandler(),
|
||||
@@ -206,11 +207,12 @@ def missing_reference(app, env, node, contnode):
|
||||
continue
|
||||
proj, version, uri, dispname = inventory[objtype][target]
|
||||
newnode = nodes.reference('', '', internal=False, refuri=uri,
|
||||
reftitle='(in %s v%s)' % (proj, version))
|
||||
reftitle=_('(in %s v%s)') % (proj, version))
|
||||
if node.get('refexplicit'):
|
||||
# use whatever title was given
|
||||
newnode.append(contnode)
|
||||
elif dispname == '-':
|
||||
elif dispname == '-' or \
|
||||
(domain == 'std' and node['reftype'] == 'keyword'):
|
||||
# use whatever title was given, but strip prefix
|
||||
title = contnode.astext()
|
||||
if in_set and title.startswith(in_set+':'):
|
||||
|
||||
Reference in New Issue
Block a user