sbin/doc/markdown2html.py
branchnew-model
changeset 929 a39ff507b050
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/sbin/doc/markdown2html.py	Fri Jul 27 19:22:25 2012 +0200
@@ -0,0 +1,32 @@
+import re, sys, markdown, codecs
+
+inputname = sys.argv[1]
+outputname = re.sub("\.\w+$",".html",inputname)
+shortname = re.sub("(^.+\/|\.\w+$)","",inputname)
+
+print "Converting %s"%shortname
+
+f = codecs.open(inputname, mode="r", encoding="utf8")
+mdtext = f.read()
+f.close()
+html = markdown.markdown(mdtext)
+
+f = codecs.open(outputname, "w", encoding="utf8")
+
+header = """<!doctype html>
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
+<title>Metadataplayer docs: %s</title>
+</head>
+<body>
+"""%shortname
+footer = """
+</body>
+</html>"""
+
+f.write(header)
+f.write(html)
+f.write(footer)
+
+f.close()
\ No newline at end of file