- outfile = os.path.basename (os.path.splitext(a)[0]) + '.html'
-
- try:
- os.unlink(outfile)
- except:
- pass
-
- s = r"""
-<body>
-<xmp>%s
-</xmp>
-</body>""" % open (a).read ()
- open (outfile, 'w').write (s)
+ # hmm, we need: text2html out/foe.txt -> out/foe.html,
+ # -o is a bit overkill?
+ # outfile = os.path.basename (os.path.splitext(a)[0]) + '.html'
+ outfile = os.path.splitext(a)[0] + '.html'
+
+ try:
+ os.unlink(outfile)
+ except:
+ pass
+
+ s = r"""
+
+<html>
+<head>
+ <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8">
+</head>
+
+<body><pre>
+%s
+</pre></body></html>
+""" % txt2html (open (a).read ())
+ open (outfile, 'w').write (s)