diff options
author | Daniel Neuhäuser <ich@danielneuhaeuser.de> | 2010-03-30 21:50:48 +0000 |
---|---|---|
committer | Daniel Neuhäuser <ich@danielneuhaeuser.de> | 2010-03-30 21:50:48 +0000 |
commit | 8cbdf1ec34cfce4bb6de8fbbf613ffc8f211233b (patch) | |
tree | 63b7ba81434ae0d669b4bef495fde4bc48682496 /sphinx/domains/javascript.py | |
parent | 8bc0248a14682a3eb9eff55804573c4090aca3ac (diff) | |
download | sphinx-git-8cbdf1ec34cfce4bb6de8fbbf613ffc8f211233b.tar.gz |
It is now possible to use the js:function:: directive for methods.
Diffstat (limited to 'sphinx/domains/javascript.py')
-rw-r--r-- | sphinx/domains/javascript.py | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/sphinx/domains/javascript.py b/sphinx/domains/javascript.py index 184ab88af..64280120a 100644 --- a/sphinx/domains/javascript.py +++ b/sphinx/domains/javascript.py @@ -31,7 +31,25 @@ class JSCallable(ObjectDescription): match = js_sig_re.match(sig) if match is None: raise ValueError() - obj, name, arglist = match.groups() + nameprefix, name, arglist = match.groups() + + objectname = self.env.temp_data.get('js:object') + if objectname and nameprefix: + # someone documenting the method of an attribute of the current + # object? shouldn't happen but who knows... + fullname = objectname + '.' + nameprefix + name + elif objectname: + fullname = objectname + '.' + name + elif nameprefix: + fullname = nameprefix + '.' + name + else: + # just a function or constructor + objectname = '' + fullname = '' + + signode['object'] = objectname + signode['fullname'] = fullname + signode += addnodes.desc_name(name, name) if not arglist: |