summaryrefslogtreecommitdiffstats
path: root/Doc/tools
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2009-09-16 09:05:11 (GMT)
committerGeorg Brandl <georg@python.org>2009-09-16 09:05:11 (GMT)
commit076ca5a430533e76416da791dbbc35096b14ddef (patch)
treeb5531767a201f22f36adf78cbc31c0e0dcbce6b1 /Doc/tools
parent0180565054199698fb803618b9b8032b110e68c4 (diff)
downloadcpython-076ca5a430533e76416da791dbbc35096b14ddef.zip
cpython-076ca5a430533e76416da791dbbc35096b14ddef.tar.gz
cpython-076ca5a430533e76416da791dbbc35096b14ddef.tar.bz2
Make deprecation notices as visible as warnings are right now.
Diffstat (limited to 'Doc/tools')
-rw-r--r--Doc/tools/sphinxext/pyspecific.py14
-rw-r--r--Doc/tools/sphinxext/static/basic.css17
2 files changed, 21 insertions, 10 deletions
diff --git a/Doc/tools/sphinxext/pyspecific.py b/Doc/tools/sphinxext/pyspecific.py
index 402a9a1..49ad940 100644
--- a/Doc/tools/sphinxext/pyspecific.py
+++ b/Doc/tools/sphinxext/pyspecific.py
@@ -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)
diff --git a/Doc/tools/sphinxext/static/basic.css b/Doc/tools/sphinxext/static/basic.css
index 169138d..03b0ba3 100644
--- a/Doc/tools/sphinxext/static/basic.css
+++ b/Doc/tools/sphinxext/static/basic.css
@@ -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;
}