index.js
function processFile(file, cb) {
        var data = dataSource(file);
        return pickTemplate(
            forcedTemplateName
                || getTemplateName(data)
                || defaultTemplateName)
            .then(function(template) {
                file.path = replaceExt(file.path, '.html');

                data._file= file;
                data._target = {
                    path: file.path,
                    relative: replaceExt(file.relative, '.html'),
                };

                // data = dataParser(data);

                var result = template.render(data);

                file.contents = new Buffer(result, 'utf-8');
                return file;
            });
    }
function processFile(file, cb) {
        var data = dataSource(file);
        return pickTemplate(
            forcedTemplateName
                || getTemplateName(data)
                || defaultTemplateName)
            .then(function(template) {
                file.path = replaceExt(file.path, '.html');

                data._file= file;
                data._target = {
                    path: file.path,
                    relative: replaceExt(file.relative, '.html'),
                };

                // data = dataParser(data);

                var result = template.render(data);

                file.contents = new Buffer(result, 'utf-8');
                return file;
            });
    }
Process one input file, may return a promise or throw an exception