2005-07-20 00:30:40 +00:00
|
|
|
#!/usr/bin/env python
|
|
|
|
|
|
|
|
import sys
|
|
|
|
|
|
|
|
if len(sys.argv) <= 1:
|
|
|
|
print >> sys.stderr, "Usage: ./changelog2html.py [changelog file]"
|
|
|
|
sys.exit(1)
|
|
|
|
|
|
|
|
f = sys.argv[1]
|
|
|
|
|
|
|
|
blah = 0
|
|
|
|
|
2009-03-30 05:17:56 +00:00
|
|
|
print '<html><head><meta http-equiv="content-type" content="text/html;charset=utf-8" /></head><body>'
|
2008-04-01 21:37:49 +00:00
|
|
|
|
2005-07-20 00:30:40 +00:00
|
|
|
for i in open(f).read().splitlines():
|
|
|
|
# ignore empty lines
|
|
|
|
|
|
|
|
if i and i[0].isspace():
|
|
|
|
if not '*' in i:
|
|
|
|
print ' ' + i.strip()
|
|
|
|
else:
|
|
|
|
s = i.split('*', 1)[1].strip()
|
2008-04-01 21:37:49 +00:00
|
|
|
print ' <li>' + s.replace('<', '<').replace('>', '>')
|
2005-07-20 00:30:40 +00:00
|
|
|
else:
|
|
|
|
if blah:
|
2008-04-01 21:37:49 +00:00
|
|
|
print '</ul>'
|
|
|
|
print '<h3>%s</h3>' % i.strip()
|
|
|
|
print '<ul>'
|
2005-07-20 00:30:40 +00:00
|
|
|
blah = 1
|
|
|
|
|
|
|
|
if blah:
|
2008-04-01 21:37:49 +00:00
|
|
|
print '</ul>'
|
|
|
|
|
|
|
|
print '</html></body>'
|