Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

[1.0.X] Fixed #9645 -- Work around a backwards-incompatibility in Sph…

…inx so that

various combinations of released docutils and sphinx versions all work
together. Thanks, Ramiro Morales.

Backport of r9586 from trunk.


git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.0.X@9587 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 76cf4db4947254c65df60bfa0df85f49b6703cb2 1 parent dc86735
@malcolmt malcolmt authored
Showing with 6 additions and 6 deletions.
  1. +6 −6 docs/_ext/djangodocs.py
View
12 docs/_ext/djangodocs.py
@@ -130,21 +130,21 @@ def depart_versionmodified(self, node):
# Give each section a unique ID -- nice for custom CSS hooks
# This is different on docutils 0.5 vs. 0.4...
-
- # The docutils 0.4 override.
- if hasattr(sphinx.htmlwriter.SmartyPantsHTMLTranslator, 'start_tag_with_title'):
+
+ if hasattr(sphinx.htmlwriter.SmartyPantsHTMLTranslator, 'start_tag_with_title') and sphinx.__version__ == '0.4.2':
def start_tag_with_title(self, node, tagname, **atts):
node = {
'classes': node.get('classes', []),
'ids': ['s-%s' % i for i in node.get('ids', [])]
}
return self.starttag(node, tagname, **atts)
-
- # The docutils 0.5 override.
- else:
+
+ else:
def visit_section(self, node):
old_ids = node.get('ids', [])
node['ids'] = ['s-' + i for i in old_ids]
+ if sphinx.__version__ != '0.4.2':
+ node['ids'].extend(old_ids)
sphinx.htmlwriter.SmartyPantsHTMLTranslator.visit_section(self, node)
node['ids'] = old_ids

0 comments on commit 76cf4db

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