grunt/tasks/styleguide.js in ustyle-1.4.1 vs grunt/tasks/styleguide.js in ustyle-1.5.8

- old
+ new

@@ -9,10 +9,11 @@ async = require('async'), path = require('path'), fs = require('fs'), dssHelper = require('../modules/dss-helper'), fileHelper = require('../modules/file'), + parser = require('../modules/html-parser'), humanize = require("underscore.string/humanize"), underscored = require("underscore.string/underscored"), slugify = require("underscore.string/slugify"), matter = require("gray-matter"), cssstats = require('cssstats'), @@ -133,19 +134,22 @@ var stats = fs.lstatSync(dir); return !stats.isDirectory(); }) .map(function(file){ var data = matter.read(file), + html = parser.removeSubNav(data.content), extension = path.extname(file), + subNavData = parser.extractSubNav(data.content), section = path.dirname(file).replace((new RegExp(contentPath + "\/?", "g")), ""), filename = path.basename(file, extension); return { name: data.data.name || humanize(filename), page: filename + '.html', template: _getTemplate(data.data.template || options.contentTemplate), section: section, - content: (fileHelper.isMarkdown(extension) ? marked(data.content) : data.content) + content: (fileHelper.isMarkdown(extension) ? marked(html) : html), + subNav: subNavData } }); var data = _sortyByIndex(pages).concat(sections);