Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mitsuhiko/jsonjinja
A Jinja2 inspired templating language for rendering JSON data on the server and client.
https://github.com/mitsuhiko/jsonjinja
Last synced: 3 months ago
JSON representation
A Jinja2 inspired templating language for rendering JSON data on the server and client.
- Host: GitHub
- URL: https://github.com/mitsuhiko/jsonjinja
- Owner: mitsuhiko
- Created: 2011-12-03T01:03:22.000Z (about 13 years ago)
- Default Branch: master
- Last Pushed: 2011-12-09T16:14:43.000Z (about 13 years ago)
- Last Synced: 2024-10-13T01:40:01.717Z (3 months ago)
- Language: Python
- Homepage:
- Size: 135 KB
- Stars: 84
- Watchers: 7
- Forks: 6
- Open Issues: 4
-
Metadata Files:
- Readme: README
Awesome Lists containing this project
README
// JSON Jinja //
a server/client templating system-- What is it?
JSON Jinja is a templating language inspired by Jinja2 with the
idea that a template should be able to operate on the same JSON
data on the server and on the client with the same semantics.It follows largely the Jinja2 feature set but restricts and
changes semantics to be better compilable to JavaScript and to
better work on different execution environments.The end goal is to define the language so that it can be
implemented in different languages without having to implement
a whole virtual machine or something similar.This implementation however is written in Python based on my
templatetk library and will generate JavaScript code for the
client that can be run with a minimal runtime library.-- Why?
To be able to use the same JSON data to render a template both
on the server and the client. The idea is that you render
the template on the server the first time the page is loaded
and from that point onwards you only transmit JSON to the client
and render on the clientside.If a browser does not have a proper history API or JavaScript
one can continue to request new pages from the server and
render them there.-- Requirements?
Currently Python 2.6 and templatetk from my github repo.
templatetk and this library are both evolving at the moment.