- else:
- return ''
-
- def _var_repl(self, word):
- if word == '{{' and not self.in_var:
- self.in_var = 1
- return '<code>'
- elif self.in_var:
- self.in_var = 0
- return '</code>'
- else:
- return ''
- def _macro_repl(self, word):
- macro_name = word[2:-2]
- # TODO: Somehow get the default value into the search field
- return apply(globals()['_macro_' + macro_name], ())
+ return ''
+
+ 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 _tr_repl(self, word):
+ out = ''
+ if not self.in_table:
+ self.in_table = True
+ self.tr_cnt = 0
+ out = '</p><table><tbody>\n'
+ self.tr_cnt += 1
+ out = out + '<tr class="' + ['even', 'odd'][self.tr_cnt % 2] + '">'
+ return out + ['<td>', '<th>'][word.strip() == '||=']
+
+ def _td_repl(self, word):
+ if self.in_table:
+ return ['</td><td>', '</th><th>'][word.strip() == '||=']
+ return ''
+
+ def _tre_repl(self, word):
+ if self.in_table:
+ return ['</td></tr>', '</th></tr>'][word.strip() == '||=']
+ return ''