generator icon indicating copy to clipboard operation
generator copied to clipboard

Templates should be able to be overriden

Open mklabs opened this issue 13 years ago • 8 comments

Originally posted on the mailing list: https://groups.google.com/forum/#!msg/yeoman-dev/M8M-kqw6S28/1FZ0xbMgBXsJ

The behaviour is not implemented yet but should be.

The idea is that when a generator invoke the .template() method, the system looks first into your project lib/templates/<generator>/<namespace> and use the template it finds instead of the built-in.

For instance, you would be able to override the template used in angular:controller generator by placing a template at lib/templates/angular/controller/controller.js

mklabs avatar Jan 27 '13 14:01 mklabs

+1

addyosmani avatar Jan 27 '13 14:01 addyosmani

:+1:

sindresorhus avatar Jan 28 '13 08:01 sindresorhus

Thanks for adding that +1

jiverson avatar Feb 02 '13 07:02 jiverson

I think we should re-investigate whether this is still something we want. If so, let's figure out the work required to get it in place :)

addyosmani avatar Mar 20 '13 17:03 addyosmani

I think it makes sense to have this. People have preferences. Instead of us supporting everything. Let us please everyone by letting them override with their own crazy stuff.

sindresorhus avatar Mar 20 '13 22:03 sindresorhus

+1 As a result it would be useful, when using sub-generators, to see the details of the different steps (e.g. instantiating template xxx into yyy.. etc), and to be able to import a copy of xxx in the local project instance with a simple yo command.

ovax3 avatar Sep 12 '13 08:09 ovax3

This can be accomplished using this.src.root.

eddiemonge avatar May 27 '14 19:05 eddiemonge

Closing as this can be implemented by generator authors and should be up to them. Like I said, you can specify a path to the template files using this.sourceRoot

eddiemonge avatar Jun 05 '14 17:06 eddiemonge