Git Product home page Git Product logo

Comments (12)

Arkkimaagi avatar Arkkimaagi commented on August 15, 2024

Another option is to fix the one line from the source. :) I'd still prefer to run with a live time formatting library rather than something that's MIA.

from handlebars-helpers.

jonschlinkert avatar jonschlinkert commented on August 15, 2024

I trust your judgement, do you recommend moment.js over other libs? Also, we can implement a new helper like {{time ""}} or {{moment ""}} and just deprecate the formatDate helper and related code until we feel pretty good about removing it. What do you think? Any interest in implementing the change?

from handlebars-helpers.

Arkkimaagi avatar Arkkimaagi commented on August 15, 2024

I think {{moment}} would be better as then people might realize that they can use moment.js documentation http://momentjs.com/ to see what's possible.

One thing tho, I'm not at ease with coffeescript. Could I do it in javascript and then we could see if we'll convert it to coffeescript with some tool or at all?

from handlebars-helpers.

jonschlinkert avatar jonschlinkert commented on August 15, 2024

Absolutely, javascript is great, the coffeescript might get thrown out anyway - I don't like it either, so no worries at all.

I guess it's an overstatement to say I don't like it. In fact, I think coffeescript is great for configuration, like as an alternative to YAML. But besides that, I don't like it. I think it would be really interesting to see "coffee front matter", because it would allow configuration that is very similar to YAML, but it would be far more powerful

from handlebars-helpers.

jonschlinkert avatar jonschlinkert commented on August 15, 2024

btw, thought you might be interested in this: https://github.com/jonschlinkert/sublime-markdown-extended. The images on the readme are actually from the Issues on that repo. I copied each image into an issue, then I copied the generated markdown link into the readme lol. Pretty interesting that it works!

from handlebars-helpers.

Arkkimaagi avatar Arkkimaagi commented on August 15, 2024

Something like?

https://github.com/Arkkimaagi/assemble-handlebars-momentjs

It does not have to be in it's own repository, but I decided to try building one quickly.

Thanks, I'll take a look at sublime-markdown-extended, is it in package manager?

from handlebars-helpers.

Arkkimaagi avatar Arkkimaagi commented on August 15, 2024

Btw, I feel almost ashamed how simple it was to build the script, it took way longer to document what one can do with it.

from handlebars-helpers.

jonschlinkert avatar jonschlinkert commented on August 15, 2024

Lol, yeah the documentation seems to always take longer. It's not structured and doesn't follow a pattern like code, and you have to think about what other people might need to know.

That's a great helper, thanks I will add a link to it in the docs. I think "assemble-helpers-momentjs" would probably make more sense. Technically the code could be generalized more later so that it could be used as either a handlebars helper, lodash mixin or as a filter with a different template language. Of course none of this matters unless you actually need something other than handlebars, so I'm just thinking out loud.

A few thoughts (I'm happy to create pull requests for some of these if you want):

  • Make sure you add a "main" property to the package.json with the path to the helper. Consider adding a bower.json for easy downloading and consumption of the helper.
  • consider putting the helper in the root of the project, and just add a test folder to demonstrate the helper. This will make it easy to consume via a method other than npm. Especially with bower.
  • Preferably name the helper something like "helper-momentjs.js". I will document this, but all helpers have been following the pattern "helper-*.js" so that they can easily be included via simple minimatch patterns.

Now with a convention for helpers it will be fast and easy to create them going forward... Hmmm, I'm going to create a grunt init package for this today. That will be nice, so everything I mentioned above will be included.

from handlebars-helpers.

Arkkimaagi avatar Arkkimaagi commented on August 15, 2024

I'll reformat the thing to work nicely, and yes a sample project on how to add this would be nice to get it rolling.

I'm ok for this code to be part of the helper-lib if you wish. I just did it as a separate repo to see if I could. :)

from handlebars-helpers.

jonschlinkert avatar jonschlinkert commented on August 15, 2024

I just added a page to the docs here: http://assemble.io/docs/Custom-Helpers.html

I'll clean it up over time, I'm adding an init project now, and an example repo.

from handlebars-helpers.

jonschlinkert avatar jonschlinkert commented on August 15, 2024

Also see this issue (created with you in mind ;-) #32

from handlebars-helpers.

jonschlinkert avatar jonschlinkert commented on August 15, 2024

Done https://github.com/jonschlinkert/grunt-init-assemble-helper

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.