jonschlinkert / grunt-readme

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

Allow multiple targets #48

Closed dgricci closed 10 years ago

dgricci commented 10 years ago

I am aiming at generating localized README (en, fr, etc ...). I modified tasks/readme.js, line 39 in ordre to replace :

grunt.registerTask('readme', "Generate ...", function() {

by

grunt.registerMultiTask('readme', "Generate ...", function() {

Could it be possible to add this feature to the project as it is the case for grunt-toc ?

jonschlinkert commented 10 years ago

The reason this is not a multitask is that multitasks must have at least one target defined in the Gruntfile. Which means that the minimum config is something like:

readme: {
  foo: {
    options: {},
    files: {
      'something/': ['else/']
    }
  }
},

But... the ideal use case for grunt-readme is to have the task just know how to use the correct templates without having any targets at all.

However, I've also had a use for a multi-task, so I created another task that has the same logic for multi-tasking, but I haven't pushed it up yet because I'm not sure if this is the best approach. Any thoughts?

dgricci commented 10 years ago

Currently my setting (with the above change) is :

        readme: {
            en: {
                options: {
                    readme: './config/md/README.tmpl.md',
                    templates: './config/md/',
                    contributing: true // generate CONTRIBUTING.md
                }
            },
            fr: {
                options: {
                    readme: './config/md/fr/README.tmpl.md',
                    templates: './config/md/fr/',
                    metadata: 'package.fr.json',
                    contributing: true // generate CONTRIBUTING.md
                }
            }
        }

If there is a work-around with templates, I would give it a try.

jonschlinkert commented 10 years ago

Closing since this repo has been deprecated.

We created a new and improved version of this: Verb, along with grunt and gulp tasks, a cli and a generator. It does what grunt-readme does, but super easy to use (requiring zero config) and waaaay more powerful for anyone who wants more than the defaults. If you like the idea of what grunt-readme does, or should do, please give Verb a look!

oh, and grunt-verb handles multiple targets :-)