diff options
| author | Luke Plant <L.Plant.98@cantab.net> | 2010-11-20 01:56:20 +0000 |
|---|---|---|
| committer | Luke Plant <L.Plant.98@cantab.net> | 2010-11-20 01:56:20 +0000 |
| commit | 8a0de6985c550ba88e5df9f1c85d9b46821c400d (patch) | |
| tree | 3d2e8d376210bf2a5f6701fc0de3c2f07fde83b9 /docs/_ext | |
| parent | 84d809d8228cde8b4a1f7c566b3915678629c7b6 (diff) | |
[1.2.X] 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
Backport of [14639] from trunk, and [14477] which was never applied to 1.2.X
branch but should have been.
git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.2.X@14640 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'docs/_ext')
| -rw-r--r-- | docs/_ext/djangodocs.py | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/docs/_ext/djangodocs.py b/docs/_ext/djangodocs.py index 2e750c030c..24be841110 100644 --- a/docs/_ext/djangodocs.py +++ b/docs/_ext/djangodocs.py @@ -233,14 +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.keys() - templatebuiltins = dict([('ttags', [n for (t,n) in xrefs if t == 'ttag']), - ('tfilters', [n for (t,n) in xrefs if t == 'tfilter'])]) - 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 = ') |
