verb
Version:
Verb makes it easy to build project documentation using simple markdown templates, with zero configuration required.
31 lines (25 loc) • 734 B
JavaScript
/**
* Verb <https://github.com/assemble/verb>
* Generate markdown documentation for GitHub projects.
*
* Copyright (c) 2014 Jon Schlinkert, Brian Woodward, contributors.
* Licensed under the MIT license.
*/
;
var template = require('template');
var _ = require('lodash');
/**
* Compile Lo-Dash templates.
*
* @param {String} str The templates to process.
* @param {Object} data Context for the templates
* @param {Object} settings Options to pass to Lo-Dash
* @return {String}
*
* @api public
*/
module.exports = function(str, data, options) {
var defaults = {delims: ['{%', '%}'], variable: ''};
var opts = _.extend({}, defaults, options);
return template(str, data || {}, opts);
};