blob: 1058c78171cca581c2d2ff1a4935117d937c7a33 [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')
onqtam8126b562016-05-27 17:01:15 +030022 md_contents = md_contents.replace(".md", ".html")
23 md_contents = md_contents.replace("```c++", "```")
hardlyb1e7e142014-08-06 00:43:51 +030024 html.write(md_contents)
25 html.write('\n\n</xmp>\n')
26 html.write('<script src="strapdown.js/strapdown.js"></script>\n')
27 html.write('</html>\n')
28 html.close()