summaryrefslogtreecommitdiffstats
path: root/kig/generate_todo_inc.pl
blob: 6999f21762e5c36914668d07849debc8ea3aec90 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#! /usr/bin/env perl

use warnings;

print "<ul>\n";
open( TODO, "<TODO" );
while( <TODO> )
  {
    if( /^\* (.*)$/ )
      {
	print "</li></ul></li>\n\n" if( $inlist );
	print "<li><span style=\"font-weight:bold\">$1</span><br/>\n";
	$inlist = 0;
	$initem = 0;
      }
    elsif( /^- (.*)$/ )
      {
	if( $initem ) { print "</li>"; };
	print "<ul>\n" if( ! $inlist );
	$inlist = 1;
	print "<li>$1\n";
	$initem = 1;
      }
    else { print unless /^$/; }
  };
print "</li></ul></li></ul>\n";