feat(make.py): implement primitive markdown -> html
icyphox icyph0x@protonmail.com
Fri, 16 Mar 2018 09:58:28 +0530
A
make.py
@@ -0,0 +1,12 @@
+from markdown2 import markdown_path +from glob import glob + +# constants +PAGES_PATH = 'pages/' +BUILD_PATH = 'build/' + +for filename in glob(PAGES_PATH + '*.md'): + html = markdown_path(PAGES_PATH + filename) + with open(BUILD_PATH + filename + '.html', 'w') as f: + f.write(html) +
M
vite.py
→
vite.py
@@ -2,7 +2,6 @@ """
Vite - A simple and minimal static site generator. """ -import markdown2 import sys import argparse import errno@@ -29,9 +28,7 @@ print('Created project directory at %s.' % (abs_path))
except FileExistsError as e: print('Error: specified path exists.') -def make_file(path): - with open(path + '/make.py', 'w') as f: - f.write('# make.py \n# Auto-generated by Vite.') +def cp_make(path): def main(): create_dirs(project_path)