Git Product home page Git Product logo

Comments (14)

doowb avatar doowb commented on July 16, 2024

@BrewDawg we're always looking for people to contribute. I think as long as they can be used under the MIT license then we'd love to have them in the repo.

@jonschlinkert just removed all of the coffee script so we're only using javascript now. You can see all the code in the lib/helpers folder. I would suggest trying to add them to the category you think they fit in, or creating a new category for some of them. Also, if they don't run into conflicts, could you remove the x prefix?

from handlebars-helpers.

jonschlinkert avatar jonschlinkert commented on July 16, 2024

👍

from handlebars-helpers.

jonschlinkert avatar jonschlinkert commented on July 16, 2024

@BrewDawg let me know if you want any help converting, I'd love to add more helpers to the project. When you add a helper remember to add some kind of attribution for yourself, like:

/**
 * {{newhelper}}
 * Description of what the helper does
 * @author: Mike Griffin <https://github.com/BrewDawg>
 */

thanks!

from handlebars-helpers.

LaurentGoderre avatar LaurentGoderre commented on July 16, 2024

Huh, I should have done that to mine....

from handlebars-helpers.

jonschlinkert avatar jonschlinkert commented on July 16, 2024

@LaurentGoderre not too late! I just thought of it today or I would have suggested it earlier. Go ahead and add those comments if you don't mind.

from handlebars-helpers.

BrewDawg avatar BrewDawg commented on July 16, 2024

Okay, I'll sync down and issue a pull request with some good ones I've created. I have some that are really useful like xNotFirst (I only added the x on mine so folks would know they are add-ons, but will strip the x when I contribute here). Notice how I use xNotFirst to avoid putting a comma at the beginning of my list of paramters into this C# function, I use handlebars to generate code in C# that is later compiled.

public void MethodThatTakesAllColumns({{#each Columns}}{{xNotFirst ","}}{{Alias}}{{/each}});

xNotFirst is true as long as it's not the first item of the {{each}} statement, problem is that it takes about three lines in the {{each}} statement to set a flag which this checks, so I won't contribute any that required me to modify the handlbars.js file itself.

I have about 10 good ones though that I can and will add.

By the way, I'm looking at forming a company around some technologies I have laying around, it will involve handlebars in the web and executing handlebars on the desktop (I already have that working, no browser needed). Here's some of my work ( http://www.tiraggo.com/ ) all side projects while holding down a full time job. It will also utilize Tiraggo and some new web technologies, if you got skills email me at [email protected] and let me know if you're interested. I've made great side money doing these things and with three kids heading into college, well, you know ...

and just recently I pushed Tiraggo.EF @ http://brewdawg.github.io/Tiraggo.EF/

from handlebars-helpers.

jonschlinkert avatar jonschlinkert commented on July 16, 2024

👍 great, thanks!

and with three kids heading into college, well, you know ..

Ha, I have two little ones and I still understand... @doowb and I are doing this because we really enjoy it, so it's great to have someone else contribute as well. We'd love to see this project (and related ones) continue to grow.

I'll take a look at the links you posted, thanks

from handlebars-helpers.

BrewDawg avatar BrewDawg commented on July 16, 2024

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 here into my project.

I would be willing to contribute but have zero time to play around with "assemble / grunt" stuff or whatever that stuff is. The format that the libs are in in this repo, 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 do you 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 and they can roll them into this repo, that would be cool.

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

Mike

from handlebars-helpers.

LaurentGoderre avatar LaurentGoderre commented on July 16, 2024

Here's a template you can use just replace the yourHelper function with your own. You can even group helpers that are related in one file.

// The module to be exported
var helpers = module.exports = {
  yourHelper: function (context, options) {
    return;
  }
};

// Export helpers
module.exports.register = function (Handlebars, options) {
  options = options || {};
  for (var helper in helpers) {
    if (helpers.hasOwnProperty(helper)) {
      Handlebars.registerHelper(helper, helpers[helper]);
    }
  }
};

from handlebars-helpers.

BrewDawg avatar BrewDawg commented on July 16, 2024

Ahhh, gotcha, now that I can understand, I'll have a pull request for you guys by the end of this weekend, thanks. By the way, I built a free online code generation using Handlebars, you can even push up your database schema and or use custom json to generate, registration is free. Give it a try, once you register you're given access to a guest repository with database schema's already uploaded for you to play with. Execute say the Tiraggo templates or the My2ndGeneration templates, they're good. The amazing thing is the templates look more like the end result rather than template code such as T4 or other code generators use. It's at http://www.my2ndgeneration.com/ and it's 100% free. For what it's worth. After you generate there's a zip file you can open.

from handlebars-helpers.

jonschlinkert avatar jonschlinkert commented on July 16, 2024

@LaurentGoderre thanks! I'll update the docs to mention the different ways that helpers can be registered.

@BrewDawg awesome, much appreciated!

from handlebars-helpers.

jonschlinkert avatar jonschlinkert commented on July 16, 2024

@BrewDawg I'm going to close this for now, but please feel free to reopen or submit a PR!

from handlebars-helpers.

BrewDawg avatar BrewDawg commented on July 16, 2024

I'm about to release a very cool "Handlebars Studio" that lets you run Handlebars in a Windows Application with all the extensions which is why I haven't uploaded them here. You can see a video of it here, beta within two weeks, there will be a fully functional free version.

http://www.tiraggo.com/movies/M2G_Desktop_Reveal_Part3.html

It's much further along than this video shows, but it gives you the idea ...

from handlebars-helpers.

jonschlinkert avatar jonschlinkert commented on July 16, 2024

I took a look at the vid, looks nice! good luck with it

from handlebars-helpers.

Related Issues (20)

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.