stephenharris/wp-readme-to-markdown

Conditionally insert content into README.md

Closed this issue · 4 comments

I'd like to add a Travis build indicator to README.md without including it in readme.txt. It would be helpful if I could conditionally insert this content into README.md

One implementation could be to be able to supply a pre_render callback in the config, and just pass the entire contents of what will be rendered in README.md through the callback if it exists.

+1 - was just trying to figure out this exact same solution. Would love to see this feature.

+1

Example usage:

grunt.initConfig({
  wp_readme_to_markdown: {
    your_target: {
        files: {
          'readme.md': 'readme.txt'
        },
        options: {
              post_convert: function( readme ) {
                    //modify readme (markdown)
                    return readme;
              }
        }
    },
  },
})

Thanks!