File: todo2html.pl

package info (click to toggle)
gltron 0.61-3
  • links: PTS
  • area: main
  • in suites: woody
  • size: 3,948 kB
  • ctags: 1,175
  • sloc: ansic: 7,580; perl: 168; makefile: 149; sh: 15
file content (34 lines) | stat: -rw-r--r-- 810 bytes parent folder | download
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
27
28
29
30
31
32
33
34
#/usr/bin/perl -w

$date = localtime;
print "<html>\n",
    "<head>\n",
	"<title>GLtron TODO list (updated $date)</title>\n",
	"<!-- generated by todo2html.pl, Andreas Umbach <marvin\@dataway.ch> -->\n",
	"<style type=\"text/css\">\n",
	"<-- h1,h2,h3,h4 { font-family:Helvetica; }\n",
	"    th { font-family:Helvetica; }\n",
	"    td { font-family:Helvetica; } -->\n",
	"</style>\n",
	"</head>\n",
	"<body bgcolor=white><h2>GLtron TODO list</h2>\n",
	"last update on <b>$date</b><p>\n";

$start = 1;
while(<>) {
	if(/^\(([^\)]*)\)/) {
		$priority = $1;
		s/^\($1\)//;
		print "<tr> <td> $priority <td> ", $_, "\n";
	} else {
		if(! $start) {
			print "</table>\n";
		}
		print "<h3>", $_, "\n";
		print "<table border=1><tr><th>Priority<th>Task\n";
		$start = 0;
	}
}
print "</table>\n",
	"</body></html>\n";