all repos — py-vite @ ff06c5b123db37252c246e3640137a8b68f709a6

the original vite, written in python

docs: add example
icyphox icyph0x@protonmail.com
Fri, 16 Mar 2018 15:05:50 +0530
commit

ff06c5b123db37252c246e3640137a8b68f709a6

parent

03c7a0d946f1b24757dcd1ccb1c4d51a09fec4cf

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

jump to
M README.mdREADME.md

@@ -13,7 +13,7 @@

*OR* ```console -$ make.py # at the project directory +$ make.py # at the project directory ``` Rendered HTML will be in `build/`

@@ -22,4 +22,4 @@

- [ ] Templating - [ ] CSS support - [ ] Implement a simple HTTP server (_later_) -- [ ] Add example site +- [x] Add example site
A example/make.py

@@ -0,0 +1,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)) +
A example/pages/build_me.md

@@ -0,0 +1,2 @@

+## Build me senpai! +run `vite.py build example`
A example/pages/example_post.md

@@ -0,0 +1,10 @@

+# Welcome to Vite + +## Vite is awesome! +il est très vite! (i'm not sure if that's correct grammar) + +## It just works! +just write your content in markdown, build it, et voilà! (too much french) + +## Try it yourself +there's another `.md` file waiting to be built :)