commit c4b7f175e647420479ace612a84e2413b66d6457
parent 155f94ff2823285e7e2642f74212e8982cf7eae1
Author: Oscar Benedito <oscar@oscarbenedito.com>
Date:   Mon, 10 Jan 2022 18:52:20 +0100

Add support for TODOs on vimwiki

Diffstat:
M.local/share/vimwiki/wiki2html.py | 3+++
1 file changed, 3 insertions(+), 0 deletions(-)

diff --git a/.local/share/vimwiki/wiki2html.py b/.local/share/vimwiki/wiki2html.py @@ -95,6 +95,9 @@ def wiki_to_html(input_file, output_file, template_file, root_path, wiki_path, c # format links for HTML text = re.sub('\[([^]]+)\]\(([^)#]*)(?:#([^)]*))?\)', href_to_html, text) + # add support for TODOs + text = re.sub('^([ \t]*- )\[[ .oO]\] ', lambda m : m.group(1) + '<input type="checkbox" disabled> ', text, flags=re.MULTILINE) + text = re.sub('^([ \t]*- )\[X\] ', lambda m : m.group(1) + '<input type="checkbox" checked disabled> ', text, flags=re.MULTILINE) params['metadata'] = '' if params['category'] != categories[0]: