jonschlinkert / grunt-readme

DEPRECATED. Use Verb instead
https://github.com/assemble/verb
Other
30 stars 10 forks source link

automatic template variables #7

Closed dylang closed 10 years ago

dylang commented 10 years ago

It would be helpful if a handful of frequently needed variables or functions were provided by default.

For example:

dylang commented 10 years ago

I just noticed in https://github.com/assemble/grunt-readme/blob/master/EXAMPLES.md some of these as examples. Maybe some of those examples could be in the readme?

jonschlinkert commented 10 years ago

Great ideas, I'll get the first two bullets added quickly. The github one sounds great too, but let me get some clarification first.

Do you want the github mixin (function) to actually pull the file/info from github? I think that's doable for sure (@JeffHerb would you be interested in helping to create a mixin for this? (here are most of the custom mixins I've added so far https://github.com/assemble/grunt-readme/blob/master/tasks/readme.js#L159-L209), I'd be happy to help with that as well).

As a first step, I think a basic mixin that just has one parameter to specify a filename would be great:

{%= _.github("filename.png") %}

The mixin would just extract user/repo name from the package.json, but we can easily add second/third parameters to override as well.

thoughts?

jonschlinkert commented 10 years ago

@dylang

Maybe some of those examples could be in the readme?

Sure, I just realized I didn't even mention the examples file in the readme, so I'll at least get that added.

dylang commented 10 years ago

{%= _.github("filename.png") %}

Awesome.

The mixin would just extract user/repo name from the package.json, but we can easily add second/third parameters to override as well.

I think getting it from the package.json is good enough.

jonschlinkert commented 10 years ago

:+1: also see: https://github.com/assemble/grunt-readme/pull/12

jonschlinkert commented 10 years ago

This was implemented a while ago (in fact I think these mixins were already there when the request was made, but I misread the request as having to do with getting assets from github)