summaryrefslogtreecommitdiff
path: root/sphinx/domains/javascript.py
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2010-05-24 12:57:07 +0200
committerGeorg Brandl <georg@python.org>2010-05-24 12:57:07 +0200
commit980c0782ae573b97163e06feaf94811d7ad58927 (patch)
treed381671d66895cf8a5dd8a599de9459a3a39763c /sphinx/domains/javascript.py
parentd20fca253699e3d85e66e4d203fb5b2a95ee23a4 (diff)
parentbfc13ad26a4eacd0396942cf4b94bda8bffe2549 (diff)
downloadsphinx-980c0782ae573b97163e06feaf94811d7ad58927.tar.gz
Merge with http://bitbucket.org/tpowers/sphinx/ (rewriting the external/internal distinction code)
In HTML output, references now get the class ``internal`` if they are internal to the whole project, as opposed to internal to the current page. The ``menuselection`` and ``guilabel`` roles now support ampersand accelerators.
Diffstat (limited to 'sphinx/domains/javascript.py')
-rw-r--r--sphinx/domains/javascript.py11
1 files changed, 5 insertions, 6 deletions
diff --git a/sphinx/domains/javascript.py b/sphinx/domains/javascript.py
index a3a4abec..31a76987 100644
--- a/sphinx/domains/javascript.py
+++ b/sphinx/domains/javascript.py
@@ -8,7 +8,6 @@
:copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
-import re
from sphinx import addnodes
from sphinx.domains import Domain, ObjType
@@ -93,7 +92,7 @@ class JSObject(ObjectDescription):
fullname = name_obj[0]
if fullname not in self.state.document.ids:
signode['names'].append(fullname)
- signode['ids'].append(fullname)
+ signode['ids'].append(fullname.replace('$', '_S_'))
signode['first'] = not self.names
self.state.document.note_explicit_target(signode)
objects = self.env.domaindata['js']['objects']
@@ -164,9 +163,9 @@ class JavaScriptDomain(Domain):
label = 'JavaScript'
# if you add a new object type make sure to edit JSObject.get_index_string
object_types = {
- 'function': ObjType(l_('JavaScript function'), 'func'),
- 'data': ObjType(l_('JavaScript data'), 'data'),
- 'attribute': ObjType(l_('JavaScript attribute'), 'attr'),
+ 'function': ObjType(l_('function'), 'func'),
+ 'data': ObjType(l_('data'), 'data'),
+ 'attribute': ObjType(l_('attribute'), 'attr'),
}
directives = {
'function': JSCallable,
@@ -215,4 +214,4 @@ class JavaScriptDomain(Domain):
def get_objects(self):
for refname, (docname, type) in self.data['objects'].iteritems():
- yield refname, type, docname, refname, 1
+ yield refname, refname, type, docname, refname, 1