I think this is my first question here. I've been lurking around on StackOverflow for quite some time now it has been a great resource to me.
I'm writing a small static site generator that works like jekyll (The end-user writes his page content in textile and the header(meta-info) in YAML - a script mashes it up with the template places everything in a directory which the server renders) in python. I'm doing this for the sake learning python.
I'm able to parse a yaml file into a dictionary; as well as convert textile into html all in python - thanks to the python libraries. The question is: how do I parse the yaml in a textile file and the textile within the same file?
Right now, the idea is to put a line separator between the yaml and the textile content: ex.
---
someyaml: someyamlcontent
anothervariable: somevalue
andsoon:
- something
- somestuff
---
_all the textile content goes here_ as well as all the **osm** here.
My sort of idea was to read the lines manually and ask if the current line is == '---' then after that the python-yaml comes in; ones the '---' is back, it's python-textile turn to work.
Are there any other ways of doing this?
Thanks in advance. :)