https://github.com/marksteve/parseltongue
Render HTML pages using Markdown and Jinja
https://github.com/marksteve/parseltongue
Last synced: 11 months ago
JSON representation
Render HTML pages using Markdown and Jinja
- Host: GitHub
- URL: https://github.com/marksteve/parseltongue
- Owner: marksteve
- Created: 2012-10-18T11:08:22.000Z (over 13 years ago)
- Default Branch: master
- Last Pushed: 2021-06-02T21:45:07.000Z (about 5 years ago)
- Last Synced: 2025-03-25T16:21:46.794Z (about 1 year ago)
- Language: Python
- Homepage: marksteve.com/parseltongue
- Size: 28.3 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Parseltongue
Render static pages using Markdown, JSON and Jinja2
## Try it
```bash
git clone https://github.com/marksteve/parseltongue.git
cd parseltongue
python setup.py install
git checkout gh-pages
parseltongue
python -m SimpleHTTPServer
```
## How it works
Parseltongue traverses the source directory (`_src` by default) for markdown
files. Each markdown file is rendered as a page.
### Templates
A template is loaded from the templates directory (`_templates` by default) for
each page. If a template of the same name (minus the extension) isn't found,
the template for the parent is loaded. (e.g. For `_src/blog/post.md`, if
`_templates/blog/post.html` is missing then `_templates/blog.html` will be
used.)
### Context
Each page has its own context. This context is retrieved from JSON files of the
same name. (e.g. `_src/page.md` uses `_src/page.json` for context) Level
context (`index.json`) is updated while traversing the source directory. So if
you set a level context value from the source directory root, that value
will be included to the context of all other pages. Index pages (`index.md`)
also get the page listing (`pages`) for its level in its context. Context
values are passed as arguments on render. They can also be accessed through
the `context` property of the `Page`.
## Warning
This project is still very rough. If you find something wrong or want to add
stuff, feel free to post an issue or a pull request.
## TODO
* Configuration
## License
http://marksteve.mit-license.org