/jinja2-nunjucks-sandbox

Jinja2 & Nunjucks sandbox

Primary LanguagePythonMIT LicenseMIT

Jinja2 & Nunjucks sandbox

(forked from qn7o/jinja2-live-parser)

A lightweight sandbox for Jinja2 and Nunjucks to test that your templates & filters are compliant with both syntaxes. All you need is Python, pip, and a web browser. Developed with Python 2.7 and verified through Python 3.6.5. Can parse JSON and YAML inputs.

TODOs

  • pull js filters out of convert.js
  • Node/NPM + Webpack instead of barebones js/jquery
  • pull more js/py filters from existing repos
  • live updating on change of template textarea

Get up and running

$ git clone git@github.com:dgirgenti/jinja2-nunjucks-sandbox.git
$ cd jinja2-nunjucks-sandbox
$ ./go

That's it! Go to http://localhost:5000

Dockerfile (I personally have not verified this!)

Build it:

docker build -t mydocker/j2parser .
docker run -d -p 5000:5000 mydocker/j2parser

Usage

Go to http://localhost:5000/ and have fun. You can add any custom filter you'd like in filters.py and convert.js (for now).

Preview

preview