Full support for highlighting TODO, FIXME, DONE keywords.
[geekigeeki.git] / geekigeeki.py
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))"