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

Any way to use Swag in Handlebars.net? #39

Closed
PhilipDaniels opened this issue Mar 13, 2015 · 3 comments
Closed

Any way to use Swag in Handlebars.net? #39

PhilipDaniels opened this issue Mar 13, 2015 · 3 comments

Comments

@PhilipDaniels
Copy link

Having just run into the (frankly amazing!) revelation that handlebars does not support an "if" statement other than testing for truthyness, (see here handlebars-lang/handlebars.js#206) I was led to the swag library: https://github.com/elving/swag

Looking at the APIs for the two projects I don't see any way to use Swag in Handlebars.net? Before I reimplement Swag in .Net...do you have any suggestions?

@rexm
Copy link
Member

rexm commented Mar 13, 2015

It's certainly possible to port any or all of the Swag helpers to .NET. I don't understand how Swag helps with the issue you linked to, though.

@PhilipDaniels
Copy link
Author

It would provide you with an IF statement that could be used to actually test conditionals other than Javascript truthiness. Among other things.

I am using your processor in my static site generator - https://github.com/PhilipDaniels/Lithogen - and I have a need for this. I will probably port some of AssembleIO's helpers as well. When I have finished I will send you a note and you can decide if you want to incorporate them into your project. It would be nice if you had a Handlebars.Helpers namespace with a bunch of pre-defined helpers which users could register.

@rexm
Copy link
Member

rexm commented Mar 16, 2015

PR is welcome. As long as we are able to preserve the intent of the project, which is to make hb templates easily executable in a native .NET process, adding ancillary helpers around the edges shouldn't interfere with that.

@rexm rexm closed this as completed Mar 17, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants