example/make.py (view raw)
1from markdown2 import markdown_path
2from glob import glob
3import os
4
5# constants
6PAGES_PATH = 'pages/'
7BUILD_PATH = 'build/'
8
9for filename in os.listdir(PAGES_PATH):
10 html = markdown_path(PAGES_PATH + filename)
11 html_file = os.path.splitext(filename)[0] + '.html'
12 with open(BUILD_PATH + html_file, 'w') as f:
13 f.write(html)
14 print('Rendered %s' % (html_file))
15