verb
Version:
Verb makes it easy to build project documentation using simple markdown templates, with zero configuration required.
28 lines (23 loc) • 573 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 _ = require('lodash');
var generate = require('marked-toc');
/**
* Generate a Table of Contents.
*
* @param {String} str
* @param {Object} options
*
* @return {String} the Table of Contents
* @api public
*/
module.exports = function(str, options) {
var opts = _.extend({}, options);
return generate(str, opts).toc || {};
};