4 ms·
Jinja live parser
- deleted 10y ago[deleted]
- neduma 10y agoIt's gonna help us for ansible/salt templates work. thanks
- tbarbugli 10y agoIs the source code available anywhere? I could actually use this myself. FYI Jinja2 is really powerful and allows you to use lot of stuff from Python (eg. execute heavy math operations, allocate lot of memory, iterate forever...) Eg. if you paste {% for i in range(10000000000) %}{% endfor %} and press Convert tens of times it will take down your site.
- networked 10y agoThe source is at https://github.com/qn7o/jinja2-live-parser https://github.com/qn7o/jinja2-live-parser. (I submitted the story but I am not the developer.)
- tbarbugli 10y agoI've added support for Heroku deploy button on my fork: https://github.com/GetStream/jinja2-live-parser https://github.com/GetStream/jinja2-live-parser
- tbarbugli 10y agolive here too now :) https://cryptic-cliffs-32040.herokuapp.com/ https://cryptic-cliffs-32040.herokuapp.com/
- reachtarunhere 10y agoCan anyone please help me understand where this can be put to use? Few comments have already mentioned some stuff vaguely. Any concrete example will really help.
- glasz 10y agoit's a templating language popular in the python community. i got in contact with it when using ansible (writing config file templates). in my context, this site can be used to test your template logic before applying it to production systems.
- wincy 10y agoWe use Jinja with our Saltstack setup at my work. We can write configuration templates that then change depending on the machine they're running on based on that machines grains, so a Debian and Red Hat based system can both have the same configuration template.
- bogomipz 10y agoSure, one use case would be Ansible. Where you frequently use complex jina filters on variables that are passed in via a variable file or dynamically at run time. Debugging these can be time consuming if you have to do run the Ansible playbook every time only to find out there a problem with your filter or templating logic.
- xandr 10y agoI stopped hosting this site, because everyone started to try "{% for i in range(10000000000) %}{% endfor %}". Stop, please, don't do it. I have not enough time for writing code to check all jinja filters and determine heavy work, if you can do it please make a pull request to original source or my fork https://github.com/xandr2/jinja2-live-parser https://github.com/xandr2/jinja2-live-parser . Originally I created this to help people who need fast check their ansible playbooks with jinja2 template rules. http://stackoverflow.com/questions/35407822/how-can-i-test-jinja2-templates-in-ansible/ http://stackoverflow.com/questions/35407822/how-can-i-test-j...