Full support for highlighting TODO, FIXME, DONE keywords.
authorBernardo Innocenti <bernie@codewiz.org>
Fri, 14 Sep 2007 13:52:37 +0000 (15:52 +0200)
committerBernardo Innocenti <bernie@codewiz.org>
Fri, 14 Sep 2007 13:52:37 +0000 (15:52 +0200)
geekigeeki.css
geekigeeki.py

index 49062cd551509042016bf19db8c52b30b8b0066e..d56bb96b54eeb618a4e250bb1c2f431bc7a8b76b 100755 (executable)
@@ -120,8 +120,18 @@ h5 {
        padding-left: 5px;
 }
 
-strong.hilight {
-       padding-left: 0.1em;
+strong.success {
+    padding-left: 0.1em;
+       background-color: #22ee22;
+}
+
+strong.notice {
+    padding-left: 0.1em;
+       background-color: #ffdd44;
+}
+
+strong.error {
+    padding-left: 0.1em;
        background-color: #ee2222;
 }
 
index aa6d332a449e2b9b3ce481e38c0862f820ce67af..57992d288b93eb1774a2a82ce051dba49cfea5ab 100755 (executable)
@@ -417,8 +417,14 @@ class PageFormatter:
             return '</pre>'
         return ''
 
-    def _hilight_repl(self, word):
-        return '<strong class="hilight">' + word + '</strong>'
+    def _hi_repl(self, word):
+        if word == 'FIXME':
+            cl = 'error'
+        elif word == 'DONE':
+            cl = 'success'
+        elif word == 'TODO':
+            cl = 'notice'
+        return '<strong class="highlight ' + cl + '">' + word + '</strong>'
 
     def _var_repl(self, word):
         if word == '{{' and not self.in_var:
@@ -496,7 +502,7 @@ class PageFormatter:
             + r"|(?P<tit>\={2,6})"
             + r"|(?P<rule>^-{3,})"
             + r"|(?P<ent>[<>&])"
-            + r"|(?P<hilight>\b(FIXME|TODO)\b)"
+            + r"|(?P<hi>\b(FIXME|TODO|DONE)\b)"
 
             # Links
             + r"|(?P<img>\b[a-zA-Z0-9_-]+\.(png|gif|jpg|jpeg|bmp))"