changeset 3236:710160c96250

Added styles for admonitions and changed the rst-parser to use them
author Mikko Virkkil? <mvirkkil@cc.hut.fi>
date Mon, 10 Mar 2008 11:25:26 +0100
parents c7fabea3fb4f
children 6ad695ff56bc
files MoinMoin/parser/text_rst.py wiki/htdocs/modern/css/common.css
diffstat 2 files changed, 35 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/parser/text_rst.py	Sun Mar 09 16:50:57 2008 +0100
+++ b/MoinMoin/parser/text_rst.py	Mon Mar 10 11:25:26 2008 +0100
@@ -479,11 +479,10 @@
 
     # Admonitions are handled here -=- tmacam
     def create_admonition_functor(self, admotion_class):
-        tag_class = 'admonition_' + admotion_class
         def visit_func(self, node):
             self.wiki_text = ''
             self.request.write(self.formatter.div(1,
-                                                  attr={'class': tag_class},
+                                                  attr={'class': admotion_class},
                                                   allowed_attrs=[]))
             self.body.append(self.wiki_text)
         def depart_func(self, node):
--- a/wiki/htdocs/modern/css/common.css	Sun Mar 09 16:50:57 2008 +0100
+++ b/wiki/htdocs/modern/css/common.css	Mon Mar 10 11:25:26 2008 +0100
@@ -468,3 +468,37 @@
 #message .warning:before {content: url('../img/alert.png'); margin: 0 0.2em;}
 #message .error:before {content: url('../img/icon-error.png'); margin: 0 0.2em;}
 
+
+/* admonition start */
+#content div.caution, 
+#content div.important, 
+#content div.note, 
+#content div.tip, 
+#content div.warning {
+    border: 1pt solid #E5E5E5;
+    background-color: #F9F9FF;
+    color: black;
+    
+    margin: 10pt 30pt 10pt 30pt;
+    background-repeat: no-repeat;
+    background-position: 8px 8px;
+    min-height: 64px; /*64=48+8+8 but doesn't work with IE*/
+    padding-left: 64px;
+}
+ 
+#content div.caution p, 
+#content div.important p, 
+#content div.note p, 
+#content div.tip p, 
+#content div.warning p {
+    margin-top: 8px; /*to align text with bg graphic*/
+}
+
+#content div.tip { background-image: url("../img/admon-tip.png"); }
+#content div.note { background-image: url("../img/admon-note.png"); }
+#content div.important { background-image: url("../img/admon-important.png"); }
+#content div.caution { background-image: url("../img/admon-caution.png"); }
+#content div.warning { background-image: url("../img/admon-warning.png"); }
+
+/* admonition end */
+