audreyfeldroy / complexity

A refreshingly simple static site generator, for those who like to work in HTML.
Other
118 stars 32 forks source link

Add YAML as an option for context files. #33

Open jmarini opened 10 years ago

jmarini commented 10 years ago

Motivation here is that YAML is easier for human reading/editing especially with regards to convenience factors such as comments and not having to quote keys. Implemented using PyYAML since this package is already a requirement for the config file. Uses PyYAML to parse both .json and .yaml/.yml files since YAML is a superset of JSON (if this is not true of PyYAML and the standard json library it is an easy fix). I'm assuming here that the speed cost is going to be negligible on most projects since YAML parsing is typically slower than JSON.

As a side note, this change also fixes bug #26 since PyYAML gracefully ignores empty files.

jmarini commented 10 years ago

Yeah thinking about it, it's probably better to have json parsed by the json module. Changed that back and added tests for yaml files.