Git Product home page Git Product logo

jinja-to-js's People

Contributors

jonbretman avatar lexicality avatar lystalex avatar lystcontractor avatar matthewlawson avatar mattvagni avatar public avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

jinja-to-js's Issues

Not an issue but a question

Very Interesting solution. I'm a fan of Python Jinja. But I ask myself the following. I use Jinja to render pages and fragments. I use fetch and the DOM to paste those fragments in my SPA pages. All async. Why would I render client-side in this setup?

Example: I have a page with a table. The first GET renders the whole page. When I need to update the table I use JSON fetch requests, which returns json with rendered html fragments (fi a table body) to update the DOM. JInja is fast, templates can be pre-compiled and minified. How / where can I benefit from your interesting solution.

Using jinja-to-js in a non-module context, small bug

Hi there,

I'm playing around with this project to see if we could use it to share template code between our client and server. So far it looks very promising!

Unfortunately, we use AngularJS dependency injection instead of modules and bower instead of npm for dependencies, which means installing the runtime was a bit of a challenge. I had to copy the runtime file, which isn't too big a big deal although it would be nice to have instructions to do so if you don't use npm.

Part of the challenge was due to one small bug: the module definition wrapper has a misnamed variable in the non-AMD, non-CommonJS case. root should be global in the immediately invoked expression at the top of the file.

This is trivial to fix, but if you'd like I'm happy to make a pull request.

Thanks!
Tom

Can't seem to get the {% with %} syntax working

Thanks for the awesome library:

I was having some trouble getting {% with %}{% endwith %} to work. I even grabbed the test case out of the projects template directory (with.jinja).

Here is the command I ran:

jinja_to_js ./templates with.jinja -m es6 -o ./js/with_jinja.js
Traceback (most recent call last):
File "/usr/local/bin/jinja_to_js", line 9, in
load_entry_point('jinja-to-js==3.1.0', 'console_scripts', 'jinja_to_js')()
File "/Library/Python/2.7/site-packages/jinja_to_js/main.py", line 92, in main
compiler = JinjaToJS(**get_init_kwargs(options))
File "/Library/Python/2.7/site-packages/jinja_to_js/init.py", line 245, in init
self._process_node(node)
File "/Library/Python/2.7/site-packages/jinja_to_js/init.py", line 306, in _process_node
raise Exception('Unknown node %s' % node)
Exception: Unknown node With(targets=[], values=[], body=[Output(nodes=[TemplateData(da etc...

Am i doing something wrong? Thanks a lot!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.