Update server side templates to use Jinja

Dokku: https://jinja.dokku.hypothes.is

Jinja[1] is a far more front-end friendly tempting system that is similar to the language that Django[2] uses, (it also has analogs in PHP[3] and Node[4]) so it's familiar to a lot of people.

This pull request...

* Swaps out chameleon for Jinja across the board.
* Moves angular templates, layouts and helpers into their own directories.
* Renames embed.txt to embed.js to avoid confusion around the content type.
* Includes a custom Jinja extension for including raw content (used for including Angular templates).

[1] http://jinja.pocoo.org/docs/dev/
[2] https://docs.djangoproject.com/en/dev/topics/templates/
[3] http://twig.sensiolabs.org
[4] https://mozilla.github.io/nunjucks/
Fine with this for now, @aron.
On Nov 5, 2014 1:15 AM, "Aron Carroll" <notifications@github.com> wrote:

> In h/subscribers.py:
>
> > @@ -15,7 +15,7 @@ def add_renderer_globals(event):
> >      event['service_url'] = request.route_url('api', subpath='')
> >
> >      # Set the blocks property to refer to the block helpers template
> > -    event['blocks'] = get_renderer('h:templates/blocks.pt').implementation()
> > +    # event['blocks'] = get_renderer('h:templates/blocks.pt').implementation()
>
> @tilgovi <https://github.com/tilgovi> wouldn't Web Platform currently be
> served by doing the following?
>
> config.override_asset('h:templates/client/auth.html', 'notes_server:templates/client/auth.html')
> config.override_asset('h:templates/client/account.html', 'notes_server:templates/client/account.html')
>
> I'm not sure how I feel about the macros approach, I can see how it keeps
> all of the overrides in a single file but on the other hand it means that
> we're going to end up with all these arbitrary bits of code extracted into
> "blocks" depending on who we're integrating with. This is going to lead to
> it becoming a dumping ground.
>
> I think I'd rather remove this for the moment and explicitly replace these
> two templates on Web Platform. Then the next time we work on an integration
> that needs to replace content we design something a little more flexible
> like the CKAN example above.
>
> Thoughts?
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/hypothesis/h/pull/1628/files#r19861589>.
>