privly/privly-applications — pull request #19 by smcgregor (2013-12-02 01:32:51+00:00)
Title: Added Templating System

The first commit adds a templating system for building Privly applications and the second commit re-renders all the current applications with the templating system. I built this to facilitate:

* **localization.** We need a build system that allows us to translate all the UI strings before the app gets to the client, despite the fact that we don't permit server-side operations to translate these strings. This build system will (eventually) allow us to wrap all UI strings in translation functions so we can distribute in multiple languages with the appropriate documentation.
* **Shared navigation.** We need the navigation of each app to facilitate seamlessly moving from one application to another. Making changes to the navigation structure in one application should not require manual changes to the navigation structure of all the other applications. #DRY
* **Simplification.** We want to simplify the application building process as much as possible. Right now I am the only one with the expertise required to manage all the application contexts {injected, extension, hosted, mobile}. This is not sustainable. A templating system formalizes how the applications interact with the different contexts. Tests can then be written to ensure that developers don't break mobile when they are developing an app on extensions.

To use the templating system, you should read `build.py`. I used Jinja2 for templating and BeautifulSoup4 for pretty printing the resulting HTML. All templated HTML must still be readable so that people can easily hack on it and verify that it isn't doing bad things.

This is not a "finished" templating system, but it is a starting point. If you have any thoughts on this direction before adoption, please comment soon.