jehugaleahsa / mustache-sharp

An extension of the mustache text template engine for .NET.
The Unlicense
306 stars 78 forks source link

Handlebars ? #11

Closed BrewDawg closed 10 years ago

BrewDawg commented 11 years ago

Has any thought been given to getting in sync with the Handlebars syntax or are you already? Do you have a sample app that executes a big template. I am the author of http://www.my2ndgeneration.com/ which is a cloud based code generator based on HandlebBars. The thing is I want to create a desktop app that will execute the templates as well. I've added some nice syntactical sugar to handlebars too as you can see here http://www.my2ndgeneration.com/TemplateLanguageDoc.aspx

I guess I'm asking if there is any chance mustach-sharp will work for me? I'm willing to help if need be.

dmason511 commented 11 years ago

Just wanted to add that I would love to see this. I am using both products and this would really be cool.

jehugaleahsa commented 11 years ago

I am in the process of adding some pretty powerful features to mustache#. As soon as I have some free time, I plan on making it possible to define/update variables within a context. This will make mustache# a small Turing-complete programming language. Unfortunately, I have been being crushed at work lately. I'd really like to see this project mature.

I am curious whether there are any particular features that Handlebars.js supports that mustache# is not. It's a lot easier to consolidate the languages if they both support the same things.

BrewDawg commented 11 years ago

Well, and you probably know this, Handlebars is just a more powerful Mustatche. This is what the site says:

Mustache templates are compatible with Handlebars, so you can take a Mustache template, import it into Handlebars, and start taking advantage of the extra Handlebars features.

http://handlebarsjs.com/

So, maybe it makes since to branch and create Handlebars# ? Just a thought, I think it is a better way to go, and you have everything in mustache still, just other stuff for Handlebars. I'll do some research and get the tags that are in Handlebars that aren't in mustache.

There is this project: https://github.com/pressf12/handlebars.cs

which use the Chrome V8 browser stuff that can fully execute javascript, this isn't a bad way to go since these template languages are always changing, but it's a more complicated setup and install by far, I like the idea of a single class library. If it were based on Handlebars 1.0.0 which was just finalized and very stable I think you'd (we the community too) would really have something.

Again, I'd be willing to help, the issue is there are handlebar "Helpers" that you register with Handlebars.registerHelper() which of course I use. Maybe a way to add extensions onto it, ie, if you see this tag, ie, {{xIf}} call my event handle in my class library which Handlebars# allows you to register. Am I dreaming or what?

jehugaleahsa commented 11 years ago

I'd appreciate you looking for tags and other features not currently supported. Mustache# has a lot of features that handlebars.js is missing, as well. I'd like to fill in any obvious gaps. Handlebars has been around longer and had a lot of exposure from people with different needs. Anything I can steal, pfft, why not?

PaulGrimshaw commented 11 years ago

I would personally love to see Equals/Greater than/Less than incorporated, similar to this project.

https://github.com/danharper/Handlebars-Helpers

The idea of variables within context is excellent too.

BrewDawg commented 11 years ago

I was looking at the library and am confused, my helpers are simply done like this ...

Handlebars.registerHelper('MyTagHere', function (fileName, options, buffer) {

}

but the ones I see in this repo have the

var helpers = module.exports = { syntax. I'm not the ultimate guru but I have a hell of a lot of really good helpers, I don't understand how I would even pull in the helpers that have been contributed into my project.

I would be willing to contribute but have zero time to mess around with "assemble / grunt" stuff or whatever that stuff is, the format these libs are in at least immediately would probably prevent me from using them. Maybe you should have an example of how in javascript you use one of the helper libs with javascript, do you just do a typical include or need require.js or what?

If somebody wants to provide me with an email id I will email them a set of killer helpers with syntax and examples in the typical Handlebars.registerHelper() syntax,

Not trying to be difficult here, I'm actually working on some thing handlebars related that has been released yet and it's taking all my time.

Mike


From: "Paul Grimshaw" notifications@github.com Sent: Tuesday, September 24, 2013 7:02 AM To: "jehugaleahsa/mustache-sharp" mustache-sharp@noreply.github.com Subject: Re: [mustache-sharp] Handlebars ? (#11)

I would personally love to see Equals/Greater than/Less than incorporated, similar to this project.

https://github.com/danharper/Handlebars-Helpers

The idea of variables within context is excellent too. - Reply to this email directly or view it on GitHub.