jch/html-pipeline — pull request #83 by gjtorikian (2013-09-10 07:35:51+00:00)
Title: Add yaml front-matter filter

GitHub Pages touts [Jekyll](https://github.com/mojombo/jekyll), which relies on YAML front-matter to represent some content metadata. However, ironically, we do a pretty lousy job of _representing_ that data in the fileview. Check out the [talks.github.com](https://github.com/github/teach.github.com/blob/gh-pages/classnotes/2013-05-28-2-private-class.md) or [developer.github.com](https://github.com/github/developer.github.com/blob/master/content/v3/repos/keys.md) repos. Since YAML front-matter starts with a `---`, it's interpreted as an `

`, and just makes everything look messy.

This PR introduces a new filter, `YamlFilter`, with the intent of it doing some pre-processing before handing off to the MarkdownFilter for the rest of the file. It tries to represent the data as a vanilla horizontal table; styling of that table should be done elsewhere. In the event that the data is mangled, the metadata is kept in a `

` tag. In the event that data is missing, nothing happens.

Because I didn't want to write giant strings in the test spec, I created a new _fixtures_ folder with before and after samples. I hope that's ok.

Please let me know your thoughts on this! Here's a screenshot of various renders from this filter:

![screen shot 2013-09-09 at 11 21 51 pm](https://f.cloud.github.com/assets/64050/1112834/1d2eb808-19eb-11e3-8ba6-75ee6147f003.png)
![screen shot 2013-09-09 at 11 57 44 pm](https://f.cloud.github.com/assets/64050/1112835/1d422672-19eb-11e3-9cb8-ca7758d7a64d.png)
![screen shot 2013-09-09 at 11 57 52 pm](https://f.cloud.github.com/assets/64050/1112836/1d4fc818-19eb-11e3-90ce-93d2621deacc.png)