From ab2a2f669563cea542a721fcbc907bb7c93d6e1f Mon Sep 17 00:00:00 2001 From: Tim Graham Date: Fri, 6 Jun 2014 20:31:23 -0400 Subject: [PATCH] [1.6.x] Removed duplicate "Deprecated in Django A.B" text in docs. sphinx 1.2+ adds this text itself. Backport of 7f4347b176 from master --- docs/_ext/djangodocs.py | 17 +++++++++-------- docs/_theme/djangodocs/static/djangodocs.css | 3 ++- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/docs/_ext/djangodocs.py b/docs/_ext/djangodocs.py index 71a8780ceef..47c7e2ce6d8 100644 --- a/docs/_ext/djangodocs.py +++ b/docs/_ext/djangodocs.py @@ -134,20 +134,21 @@ class DjangoHTMLTranslator(SmartyPantsHTMLTranslator): # that work. # version_text = { - 'deprecated': 'Deprecated in Django %s', - 'versionchanged': 'Changed in Django %s', - 'versionadded': 'New in Django %s', + 'versionchanged': 'Changed in Django %s', + 'versionadded': 'New in Django %s', } def visit_versionmodified(self, node): self.body.append( self.starttag(node, 'div', CLASS=node['type']) ) - title = "%s%s" % ( - self.version_text[node['type']] % node['version'], - ":" if len(node) else "." - ) - self.body.append('%s ' % title) + version_text = self.version_text.get(node['type']) + if version_text: + title = "%s%s" % ( + version_text % node['version'], + ":" if len(node) else "." + ) + self.body.append('%s ' % title) def depart_versionmodified(self, node): self.body.append("\n") diff --git a/docs/_theme/djangodocs/static/djangodocs.css b/docs/_theme/djangodocs/static/djangodocs.css index 86ac07adb4c..6579202cb96 100644 --- a/docs/_theme/djangodocs/static/djangodocs.css +++ b/docs/_theme/djangodocs/static/djangodocs.css @@ -117,7 +117,8 @@ div.admonition-behind-the-scenes { padding-left:65px; background:url(docicons-be /*** versoinadded/changes ***/ div.versionadded, div.versionchanged { } -div.versionadded span.title, div.versionchanged span.title, div.deprecated span.title { font-weight: bold; } +div.versionadded span.title, div.versionchanged span.title, span.versionmodified { font-weight: bold; } +div.deprecated { color:#555; } /*** p-links ***/ a.headerlink { color: #c60f0f; font-size: 0.8em; padding: 0 4px 0 4px; text-decoration: none; visibility: hidden; }