Gruntfile.js
function (obj) {
  var toc = [],
    tocTmpl = _.template("* [<%= heading %>](#<%= id %>)\n"),
    sectionTmpl = _.template("### <%= summary %>\n\n<%= body %>\n");

  // Finesse comment markdown data.
  // Also, statefully create TOC.
  var sections = _.chain(obj)
    .filter(function (c) {
      return !c.isPrivate && !c.ignore && _.any(c.tags, function (t) {
        return t.type === "api" && t.visibility === "public";
      });
    })
    .map(function (c) {
      // Add to TOC.
      toc.push(tocTmpl({
        heading: c.description.summary,
        id: _headingId(c.description.summary)
      }));

      return sectionTmpl(c.description);
    })
    .value()
    .join("");

  return "\n" + toc.join("") + "\n" + sections;
}
function (obj) {
  var toc = [],
    tocTmpl = _.template("* [<%= heading %>](#<%= id %>)\n"),
    sectionTmpl = _.template("### <%= summary %>\n\n<%= body %>\n");

  // Finesse comment markdown data.
  // Also, statefully create TOC.
  var sections = _.chain(obj)
    .filter(function (c) {
      return !c.isPrivate && !c.ignore && _.any(c.tags, function (t) {
        return t.type === "api" && t.visibility === "public";
      });
    })
    .map(function (c) {
      // Add to TOC.
      toc.push(tocTmpl({
        heading: c.description.summary,
        id: _headingId(c.description.summary)
      }));

      return sectionTmpl(c.description);
    })
    .value()
    .join("");

  return "\n" + toc.join("") + "\n" + sections;
}
function ( obj ) { var toc = [ ] , tocTmpl = _ . template ( "* [<%= heading %>](#<%= id %>)\n" ) , sectionTmpl = _ . template ( "### <%= summary %>\n\n<%= body %>\n" ) ; // Finesse comment markdown data. // Also, statefully create TOC. var sections = _ . chain ( obj ) . filter ( function ( c ) { return ! c . isPrivate && ! c . ignore && _ . any ( c . tags , function ( t ) { return t . type === "api" && t . visibility === "public" ; } ) ; } ) . map ( function ( c ) { // Add to TOC. toc . push ( tocTmpl ( { heading : c . description . summary , id : _headingId ( c . description . summary ) } ) ) ; return sectionTmpl ( c . description ) ; } ) . value ( ) . join ( "" ) ; return "\n" + toc . join ( "" ) + "\n" + sections ; }
Generate Markdown API snippets from dox object.
Generate Markdown API snippets from dox object .