Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

[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
  • Loading branch information...
commit 8a0de6985c550ba88e5df9f1c85d9b46821c400d 1 parent 84d809d
Luke Plant authored

Showing 1 changed file with 7 additions and 8 deletions. Show diff stats Hide diff stats

  1. 15  docs/_ext/djangodocs.py
15  docs/_ext/djangodocs.py
@@ -233,14 +233,13 @@ def finish(self):
233 233
             self.warn("cannot create templatebuiltins.js due to missing simplejson dependency")
234 234
             return
235 235
         self.info(bold("writing templatebuiltins.js..."))
236  
-        try:
237  
-            xrefs = self.env.reftargets.keys()
238  
-            templatebuiltins = dict([('ttags', [n for (t,n) in xrefs if t == 'ttag']),
239  
-                                     ('tfilters', [n for (t,n) in xrefs if t == 'tfilter'])])
240  
-        except AttributeError:
241  
-            xrefs = self.env.domaindata["std"]["objects"]
242  
-            templatebuiltins = dict([('ttags', [n for (t,n) in xrefs if t == 'templatetag']),
243  
-                                     ('tfilters', [n for (t,n) in xrefs if t == 'templatefilter'])])
  236
+        xrefs = self.env.domaindata["std"]["objects"]
  237
+        templatebuiltins = dict([('ttags', [n for ((t,n), (l,a)) in xrefs.items()
  238
+                                            if t == 'templatetag' and
  239
+                                            l == 'ref/templates/builtins' ]),
  240
+                                 ('tfilters', [n for ((t,n), (l,a)) in xrefs.items()
  241
+                                               if t == 'templatefilter' and
  242
+                                               t == 'ref/templates/builtins'])])
244 243
         outfilename = os.path.join(self.outdir, "templatebuiltins.js")
245 244
         f = open(outfilename, 'wb')
246 245
         f.write('var django_template_builtins = ')

0 notes on commit 8a0de69

Please sign in to comment.
Something went wrong with that request. Please try again.