all repos — py-vite @ 4d50778cee5739c457864d2b08e3106c07936664

the original vite, written in python

example/make.py (view raw)

 1
 2
 3
 4
 5
 6
 7
 8
 9
 10
 11
 12
 13
 14
 15
from markdown2 import markdown_path
from glob import glob
import os

# constants
PAGES_PATH = 'pages/'
BUILD_PATH = 'build/'

for filename in os.listdir(PAGES_PATH):
    html = markdown_path(PAGES_PATH + filename)
    html_file = os.path.splitext(filename)[0] + '.html'
    with open(BUILD_PATH + html_file, 'w') as f:
        f.write(html)
        print('Rendered %s' % (html_file))