all repos — py-vite @ 6b37adb6b9fdcc5dca82e438685298147d2e5142

the original vite, written in python

feat(make.py): implement primitive markdown -> html
icyphox icyph0x@protonmail.com
Fri, 16 Mar 2018 09:58:28 +0530
commit

6b37adb6b9fdcc5dca82e438685298147d2e5142

parent

8a6a3f5f339ffec38190d57d50a84b3e5a575d9b

2 files changed, 13 insertions(+), 4 deletions(-)

jump to
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.pyvite.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)