Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for templating engine Nunjucks #232

Closed
aharonp opened this issue Jul 17, 2013 · 5 comments
Closed

Support for templating engine Nunjucks #232

aharonp opened this issue Jul 17, 2013 · 5 comments

Comments

@aharonp
Copy link

aharonp commented Jul 17, 2013

Any chance of adding support for Nunjucks, a direct port of Python's fantastic Jinja2 templating engine?

Truth is this isn't high priority as I'm primarily using it on the server side, however I am also considering using it on the client side and wanted to get an idea of how difficult it would be to add support into Mimosa.

@dbashford
Copy link
Owner

Without digging too deep, it looks like it has some kind of a node API. That would be the question, does it expose an API with which I can precompile templates.

Maybe @jlongster can chime in?

@Anachron
Copy link
Contributor

Anachron commented Oct 1, 2013

Just took a quick check and actually this should be pretty simple for the express-installation-method (http://nunjucks.jlongster.com/#Express). About local mimosa server, I have no idea.

@dbashford
Copy link
Owner

mimosa's server depends on consolidate, which, unfortunately, isn't a super well maintained project since its creator and maintainer is a pretty busy guy.

Implementing it yourself within your own server is a piece of cake as those docs indicate.

I think the issue is requesting client support though. Client support for any templating language is a 1 hour task if there is an established node api for precompilation, or if precompilation isn't necessary for some reason.

My plan was to whip through all the new compiler requests over the next few weeks after I've got 1.0 out the door. Most of them should be fairly simple.

@Anachron
Copy link
Contributor

Anachron commented Oct 1, 2013

Since the consolidate author is pretty "busy", why not
1.) Fork it and maintain an own version (with permission) or
2.) Write your own wrapper? (Looking at the code it doesn't seem to be too complicated)
3.) Send PR-Request with your "local" changes.

As for the list of template languages, I would like to throw this into:
https://github.com/joyent/node/wiki/modules#wiki-templating

Edit: Added option 3.
Edit 2: Actually option 3 would be kinda smart. You will help thousands of users and it will give mimosa some publicity. Think of it!

@dbashford
Copy link
Owner

Another case of better late than never!

I've created https://github.com/dbashford/mimosa-nunjucks

Will soon release and update for mimosa that'll include scaffolding for mimosa new + nunjucks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants