Please see the Grunt documentation for more information regarding task creation: http://gruntjs.com/creating-tasks 
find all stylesheet links and javascript tags,
read the css/js file to fill in the html code

@param  {string} filepath
@return {string}
976440
function combo(filepath) {
    var linkPattern = /<link\s([^>]+)>/g;
    var scriptPattern = /<script\s([^>]+)>/g;

    var html = grunt.file.read(filepath);

    html = html.replace(linkPattern, function (content) {
      var href = getAttribute(content, 'href');
      var ignore = getAttribute(content, 'ignore');

      if (href.match(/\/\//) || isTruthy(ignore)) {
        return content;
      }
      return '<style>\n' + grunt.file.read(path.join(filepath, '../', href)) + '\n</style>';
    });

    html = html.replace(scriptPattern, function (content) {
      var src = getAttribute(content, 'src');
      var ignore = getAttribute(content, 'ignore');

      if (src.match(/\/\//) || isTruthy(ignore)) {
        return content;
      }
      return '<script>\n' + grunt.file.read(path.join(filepath, '../', src)) + '\n';
    });

    return html;
  }
533301
function (filepath, content){
        try{
            grunt.file.write(filepath, content);
            grunt.log.writeln('File "' + filepath + '" wrapped and saved.');
        } catch (err){
            grunt.fail.fatal(err);
        }
    }
663540
function inlineStylesheet($, filepath) {
  $('link[rel=stylesheet][href]').each(function() {
    var el      = $(this);
    var href    = el.attr('href');
    if(ABS.test(href)) return;
    var relpath = /^\./.test(href) ? href : './' + href;
    var srcpath = resolve.sync(relpath, {
      basedir    : dirname(filepath),
      extensions : [extname(relpath)]
    })
    var content = read(srcpath);
    var style = whacko('<style>' + content + '</style>');
    style.attr(el.attr());
    style.attr('href', null);
    style.attr('rel', null);
    el.replaceWith(whacko.html(style));
  })
}
632762
function (filepath, options) {
    var content = grunt.file.read(filepath);
    if (isPugTemplate(filepath)) {
      var pug = require('pug');
      options.pug.filename = filepath;
      content = pug.render(content, options.pug);
    }

    // Process files as templates if requested.
    var process = options.process;
    if (typeof process === 'function') {
      content = process(content, filepath);
    } else if (process) {
      if (process === true) {
        process = {};
      }
      content = grunt.template.process(content, process);
    }

    if (Object.keys(options.htmlmin).length) {
      try {
        content = minify(content, options.htmlmin);
      } catch (err) {
        grunt.warn(filepath + '\n' + err);
      }
    }

    // trim leading whitespace
    content = content.replace(/(^\s*)/g, '');

    return escapeContent(content, options.quoteChar, options.indentString, options.templatePathInComment ? filepath : '');
  }
1345637
function ruleSync(filePath) {
  var ruleId = path.basename(filePath)
  var result = {}
  var tests = {}
  var description
  var code
  var tags
  var name

  ruleId = ruleId.slice('remark-lint-'.length)
  code = fs.readFileSync(path.join(filePath, 'index.js'), 'utf-8')
  tags = dox.parseComments(code)[0].tags
  description = find(tags, 'fileoverview')
  name = find(tags, 'module')

  /* istanbul ignore if */
  if (name !== ruleId) {
    throw new Error(ruleId + ' has an invalid `@module`: ' + name)
  }

  /* istanbul ignore if */
  if (!description) {
    throw new Error(ruleId + ' is missing a `@fileoverview`')
  }

  description = strip(description)

  result.ruleId = ruleId
  result.description = trim(description)
  result.tests = tests
  result.filePath = filePath

  find
    .all(tags, 'example')
    .map(strip)
    .forEach(check)

  return result

  function check(example) {
    var lines = example.split('\n')
    var value = strip(lines.slice(1).join('\n'))
    var info
    var setting
    var context
    var name

    try {
      info = JSON.parse(lines[0])
    } catch (error) {
      /* istanbul ignore next */
      throw new Error(
        'Could not parse example in ' + ruleId + ':\n' + error.stack
      )
    }

    setting = JSON.stringify(info.setting || true)
    context = tests[setting]
    name = info.name

    if (!context) {
      context = []
      tests[setting] = context
    }

    if (!info.label) {
      context[name] = {
        config: info.config || {},
        setting: setting,
        input: value,
        output: []
      }

      return
    }

    /* istanbul ignore if */
    if (info.label !== 'input' && info.label !== 'output') {
      throw new Error(
        'Expected `input` or `ouput` for `label` in ' +
          ruleId +
          ', not `' +
          info.label +
          '`'
      )
    }

    if (!context[name]) {
      context[name] = {config: info.config || {}}
    }

    context[name].setting = setting

    if (info.label === 'output') {
      value = value.split('\n')
    }

    context[name][info.label] = value
  }
}
527247
function tryReaddir(filepath) {
  var ctx = { path: filepath, files: [] };
  try {
    ctx.files = fs.readdirSync(filepath);
    return ctx;
  } catch (err) {}
  try {
    ctx.path = path.dirname(filepath);
    ctx.files = fs.readdirSync(ctx.path);
    return ctx;
  } catch (err) {}
  return null;
}
1009750
function loadJSConfigFile(filePath) {
    debug(`Loading JS config file: ${filePath}`);
    try {
        return importFresh(filePath);
    } catch (e) {
        debug(`Error reading JavaScript file: ${filePath}`);
        e.message = `Cannot read config file: ${filePath}\nError: ${e.message}`;
        throw e;
    }
}
55529
function buildComponentAndCheckConformance(filepath) {
  var componentDir = path.join(process.cwd(), path.dirname(filepath));
  var deferred = Q.defer();

  resolve(componentDir, options.resolveOpts, function(err, tree) {
    if (err) {
      return deferred.reject(err);
    }

    var build = Build(flatten(tree));

    build.stylePlugins = function(build) {
      build.use('styles', function(file, done) {
        file.read(function(err, string) {
          if (err) {
            return deferred.reject(err);
          }

          if (options.conform) {
            try {
              file.string = conform(string);
            } catch (e) {
              return deferred.reject(e);
            }
          }

          done();
        });
      });
    };

    build.styles(function(err, builtCSS) {
      if (err) {
        return deferred.reject(err);
      }

      deferred.resolve(builtCSS);
    });
  });

  return deferred.promise;
}
305322
async function loadConfigFile(filePath) {
  const f = await Promise.any(
    _.map(['.yml', '.yaml', '.json', ''], async(ext) =>
      await utils.fileExists(`${filePath}${ext}`)));
  if (f) {
    return loadYaml(await fs.readFileAsync(f));
  }
  return undefined;
}
217229
function loadJS(filePath) {
  console.log("Found "+filePath);
  var contents = fs.readFileSync(filePath, {encoding:"utf8"});
  return eval(contents);
  /* the code below would be better, but it doesn't seem to work when running
   CLI - works fine when running as a module. */ 
  //return require("vm").runInThisContext(contents, filePath );
}
393777
function requirePath(fromPath, require) {
  // console.log('requirePath:fromPath: ' + fromPath);
  // console.log('requirePath:require: ' + require);
  if (fromPath === null || fromPath === undefined
    || require === null || require === undefined) {
    return null;
  }
  var filePath = path.resolve(path.dirname(fromPath), require);
  return realRequirPath(filePath);
}
803789
function RunGruntTask(taskname,absolutePath) {
    var exec = require('child_process').exec;
    var gruntarg = ' --gruntfile ';
    var space = ' ';

    if (os === 'Windows_NT') {
        gruntPath = 'node_modules\\grunt-cli\\bin\\grunt' || absolutePath;
        var ShellTask = gruntPath + space + gruntarg + gruntfile + space + taskname;
        var GruntTask = new shell(ShellTask);
        GruntTask.on('output', function(data) {
            console.log(data);
        });
        GruntTask.on('end', function(code) {
            console.log("Execution done");
        });
    }

    if (os === 'Darwin' || os === 'Linux') {
        gruntPath = 'node_modules/grunt-cli/bin/grunt';
        var child = exec(gruntPath + gruntarg + gruntfile + space + taskname, function(error, stdout, stderr) {
            if (error !== null) {
                console.log('exec error: ' + error);
                var stdout = error;
                return stdout;
            } else {
                console.log('stdout: ' + stdout);
                return stdout;
            }

        });
    }
}
1077535
function getYmlsInsideFolder (folderPath) {
  return new Promise((resolve, reject) => {
    if (!fs.existsSync(folderPath)) {
      reject('Cant\' find syntax templates folder: ' + folderPath)
    } else {
      fs.readdir(folderPath, (err, data) => {
        if (err) reject('Error reading syntax templates folder: ' + folderPath)
        else {
          resolve(
            data
            .filter(i => path.basename(i) !== path.basename(i, '.yml'))
            .map(i => path.resolve(folderPath, i))
          )
        }
      })
    }
  })
}
890337
function getorigPath(filePath, base) {
    var extName = path.extname(filePath);
    var pt = path.resolve(base, filePath);
    if (!extName) pt += '.js';
    return pt;
}
1367288
function metapath(filepath) {
    return path.join(path.dirname(filepath), '.' + path.basename(filepath));
}
17271
function loadJSONConfigFile(filePath) {
    debug(`Loading JSON config file: ${filePath}`);

    try {
        return JSON.parse(stripComments(readFile(filePath)));
    } catch (e) {
        debug(`Error reading JSON file: ${filePath}`);
        e.message = `Cannot read config file: ${filePath}\nError: ${e.message}`;
        e.messageTemplate = "failed-to-read-json";
        e.messageData = {
            path: filePath,
            message: e.message
        };
        throw e;
    }
}
63697
function existence ( filepath ) {
		var does = grunt.file.exists ( filepath );
		if ( !does ) {
			grunt.log.warn ( filepath + " not found." );
		}
		return does;
	}