docs: add example
icyphox icyph0x@protonmail.com
Fri, 16 Mar 2018 15:05:50 +0530
4 files changed,
29 insertions(+),
2 deletions(-)
M
README.md
→
README.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/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 :)