From 10a9870db7d40c7375470061274902fc9f38f3a6 Mon Sep 17 00:00:00 2001 From: Bernardo Innocenti Date: Fri, 14 Sep 2007 15:52:37 +0200 Subject: [PATCH] Full support for highlighting TODO, FIXME, DONE keywords. --- geekigeeki.css | 14 ++++++++++++-- geekigeeki.py | 12 +++++++++--- 2 files changed, 21 insertions(+), 5 deletions(-) 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))" -- 2.25.1