blob: a82a579f570d41f9968b769d30a7b954b9b476bc [file] [log] [blame]
hardlyb1e7e142014-08-06 00:43:51 +03001#!/usr/bin/python2.7
2
3import os
4
5html_dir = "../doc/html_generated/"
6md_dir = "../doc/markdown/"
7
8filelist = [f for f in os.listdir(html_dir) if f.endswith(".html")]
9for f in filelist:
10 os.remove(html_dir + f)
11
12for filename in os.listdir(md_dir):
13 if filename[-2:] == "md":
14 md = open(md_dir + filename, "r")
15 md_contents = md.read()
16 md.close()
17 html = open(html_dir + filename[:-3] + ".html", "w")
18 html.write('<!DOCTYPE html>\n')
19 html.write('<html>\n')
20 html.write('<title>' + filename[:-3] + '</title>\n')
21 html.write('<xmp theme="united" style="display:none;">\n\n')
22 md_contents = md_contents.replace(".md)", ".html)")
23 html.write(md_contents)
24 html.write('\n\n</xmp>\n')
25 html.write('<script src="strapdown.js/strapdown.js"></script>\n')
26 html.write('</html>\n')
27 html.close()
28 os.system("git add " + html_dir + filename[:-3] + ".html")