[Python-checkins] r74817 - in python/trunk/Doc/tools/sphinxext: pyspecific.py static/basic.css

georg.brandl python-checkins at python.org
Wed Sep 16 11:05:11 CEST 2009


Author: georg.brandl
Date: Wed Sep 16 11:05:11 2009
New Revision: 74817
Log:
Make deprecation notices as visible as warnings are right now.
Modified:
 python/trunk/Doc/tools/sphinxext/pyspecific.py
 python/trunk/Doc/tools/sphinxext/static/basic.css
Modified: python/trunk/Doc/tools/sphinxext/pyspecific.py
==============================================================================
--- python/trunk/Doc/tools/sphinxext/pyspecific.py	(original)
+++ python/trunk/Doc/tools/sphinxext/pyspecific.py	Wed Sep 16 11:05:11 2009
@@ -20,6 +20,20 @@
 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)
Modified: python/trunk/Doc/tools/sphinxext/static/basic.css
==============================================================================
--- python/trunk/Doc/tools/sphinxext/static/basic.css	(original)
+++ python/trunk/Doc/tools/sphinxext/static/basic.css	Wed Sep 16 11:05:11 2009
@@ -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 @@
 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 @@
 vertical-align: middle;
 }
 
-div.math p {
+div.body div.math p {
 text-align: center;
 }
 


More information about the Python-checkins mailing list

AltStyle によって変換されたページ (->オリジナル) /