adamayres/gulp-wrap — pull request #1 by uhunkler (2014-01-19 15:41:10+00:00)
Title: Extend the plugin to get the template data from a defined object saved o...

Extend the plugin to get the template data from a defined object saved on the file object.

Thanks for your great gulp-wrap plugin. I need a wrap plugin that is able to use data saved on the file object by a previous called pluign. I extended your pluign. Are you interested to include the extension?

I changed the data parameter to except either an object or a string. When a string is given the plugin creates a data object and sets the object to the property with the same name attached to the file object. The data can be set bey another plugin.

I want to use a gulp workflow to process markdown files with a frontmatter for the page content and place the content into a saved html wrapper with header and footer. The frontmatter data is extracted from the markdown file and saved in a property (with a default or given name) on the file object by the frontmatter plugin. The wrap plugin can now read the frontmatter data when I set the data as a string with the property name.

There are some other small changes I included to get the index.js file pass jslint.

Signed-off-by: uhunkler