diff options
| author | Luke Plant <L.Plant.98@cantab.net> | 2010-11-20 01:37:54 +0000 |
|---|---|---|
| committer | Luke Plant <L.Plant.98@cantab.net> | 2010-11-20 01:37:54 +0000 |
| commit | ec7c49f2534284b1d9e67141d660a174ffadb3eb (patch) | |
| tree | 99f0f9b5f7bf3b7518d828f79bf4d29d546c534e | |
| parent | 58eca97e71742f1b735851938c443fdab7555db9 (diff) | |
Fixed hyperlinking of template tags for Sphinx >= 1.0
Follow on from incomplete fix in [14477], and [14631] which removed
compatibility for Sphinx < 1.0
git-svn-id: http://code.djangoproject.com/svn/django/trunk@14639 bcc190cf-cafb-0310-a4f2-bffc1f526a37
| -rw-r--r-- | docs/_ext/djangodocs.py | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/docs/_ext/djangodocs.py b/docs/_ext/djangodocs.py index 898a2ee2be..24be841110 100644 --- a/docs/_ext/djangodocs.py +++ b/docs/_ext/djangodocs.py @@ -233,18 +233,13 @@ class DjangoStandaloneHTMLBuilder(StandaloneHTMLBuilder): self.warn("cannot create templatebuiltins.js due to missing simplejson dependency") return self.info(bold("writing templatebuiltins.js...")) - try: - xrefs = self.env.reftargets.items() - templatebuiltins = dict([('ttags', [n for ((t,n),(l,a)) in xrefs - if t == 'ttag' and - l == 'ref/templates/builtins']), - ('tfilters', [n for ((t,n),(l,a)) in xrefs - if t == 'tfilter' and - l == 'ref/templates/builtins'])]) - except AttributeError: - xrefs = self.env.domaindata["std"]["objects"] - templatebuiltins = dict([('ttags', [n for (t,n) in xrefs if t == 'templatetag']), - ('tfilters', [n for (t,n) in xrefs if t == 'templatefilter'])]) + xrefs = self.env.domaindata["std"]["objects"] + templatebuiltins = dict([('ttags', [n for ((t,n), (l,a)) in xrefs.items() + if t == 'templatetag' and + l == 'ref/templates/builtins' ]), + ('tfilters', [n for ((t,n), (l,a)) in xrefs.items() + if t == 'templatefilter' and + t == 'ref/templates/builtins'])]) outfilename = os.path.join(self.outdir, "templatebuiltins.js") f = open(outfilename, 'wb') f.write('var django_template_builtins = ') |
