From: Bernardo Innocenti Date: Fri, 14 Sep 2007 13:52:37 +0000 (+0200) Subject: Full support for highlighting TODO, FIXME, DONE keywords. X-Git-Tag: v2.0~5 X-Git-Url: https://codewiz.org/gitweb?a=commitdiff_plain;h=10a9870db7d40c7375470061274902fc9f38f3a6;p=geekigeeki.git Full support for highlighting TODO, FIXME, DONE keywords. --- diff --git a/geekigeeki.css b/geekigeeki.css index 49062cd..d56bb96 100755 --- a/geekigeeki.css +++ b/geekigeeki.css @@ -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; } diff --git a/geekigeeki.py b/geekigeeki.py index aa6d332..57992d2 100755 --- a/geekigeeki.py +++ b/geekigeeki.py @@ -417,8 +417,14 @@ class PageFormatter: return '' return '' - def _hilight_repl(self, word): - return '' + word + '' + def _hi_repl(self, word): + if word == 'FIXME': + cl = 'error' + elif word == 'DONE': + cl = 'success' + elif word == 'TODO': + cl = 'notice' + return '' + word + '' def _var_repl(self, word): if word == '{{' and not self.in_var: @@ -496,7 +502,7 @@ class PageFormatter: + r"|(?P\={2,6})" + r"|(?P^-{3,})" + r"|(?P[<>&])" - + r"|(?P\b(FIXME|TODO)\b)" + + r"|(?P\b(FIXME|TODO|DONE)\b)" # Links + r"|(?P\b[a-zA-Z0-9_-]+\.(png|gif|jpg|jpeg|bmp))"