verb
Version:
A project without documentation is like a project that doesn't exist. Verb solves this by making it dead simple to generate docs, using simple markdown templates, with zero configuration required.
16 lines (14 loc) • 302 B
JavaScript
const toc = 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) {
options = options || {};
return toc(str, options).toc || {};
};