]> granicus.if.org Git - python/commitdiff
Make deprecation notices as visible as warnings are right now.
authorGeorg Brandl <georg@python.org>
Wed, 16 Sep 2009 09:05:11 +0000 (09:05 +0000)
committerGeorg Brandl <georg@python.org>
Wed, 16 Sep 2009 09:05:11 +0000 (09:05 +0000)
Doc/tools/sphinxext/pyspecific.py
Doc/tools/sphinxext/static/basic.css

index 402a9a18e53934016761a31962ab76c6be99232b..49ad940e76401e24341c4f0ae5b99fcda59b2ae0 100644 (file)
@@ -20,6 +20,20 @@ Body.enum.converters['loweralpha'] = \
     Body.enum.converters['lowerroman'] = \
     Body.enum.converters['upperroman'] = lambda x: None
 
+# monkey-patch HTML translator to give versionmodified paragraphs a class
+def new_visit_versionmodified(self, node):
+    self.body.append(self.starttag(node, 'p', CLASS=node['type']))
+    text = versionlabels[node['type']] % node['version']
+    if len(node):
+        text += ': '
+    else:
+        text += '.'
+    self.body.append('<span class="versionmodified">%s</span>' % text)
+
+from sphinx.writers.html import HTMLTranslator
+from sphinx.locale import versionlabels
+HTMLTranslator.visit_versionmodified = new_visit_versionmodified
+
 
 def issue_role(typ, rawtext, text, lineno, inliner, options={}, content=[]):
     issue = utils.unescape(text)
index 169138d894af7509fe09f4af99f78f68cc57b42b..03b0ba34249386888af899d56b9994544f4642de 100644 (file)
@@ -5,15 +5,6 @@
 
 /* -- main layout ----------------------------------------------------------- */
 
-div.documentwrapper {
-    float: left;
-    width: 100%;
-}
-
-div.bodywrapper {
-    margin: 0 0 0 230px;
-}
-
 div.clearer {
     clear: both;
 }
@@ -338,6 +329,12 @@ dl.glossary dt {
     font-style: italic;
 }
 
+p.deprecated {
+    background-color: #ffe4e4;
+    border: 1px solid #f66;
+    padding: 7px
+}
+
 .system-message {
     background-color: #fda;
     padding: 5px;
@@ -394,7 +391,7 @@ img.math {
     vertical-align: middle;
 }
 
-div.math p {
+div.body div.math p {
     text-align: center;
 }