From ea03583d3d86d0bc35adf0d1a7a4d674584a4245 Mon Sep 17 00:00:00 2001 From: "qingwei.li" Date: Sun, 27 Nov 2016 18:56:25 +0800 Subject: [PATCH] bump 0.4.0 --- lib/docsify.js | 41 +++++++++++++++++++++++++++-------------- lib/docsify.min.js | 2 +- 2 files changed, 28 insertions(+), 15 deletions(-) diff --git a/lib/docsify.js b/lib/docsify.js index 0d43d523..0833b1d3 100644 --- a/lib/docsify.js +++ b/lib/docsify.js @@ -2141,7 +2141,7 @@ var buildHeadlinesTree = function (tree, tpl) { if (!tree || !tree.length) { return '' } tree.forEach(function (node) { - tpl += "
  • " + (node.title) + "
  • "; + tpl += "
  • " + (node.title) + "
  • "; if (node.children) { tpl += "
  • "; } @@ -2150,8 +2150,11 @@ var buildHeadlinesTree = function (tree, tpl) { return tpl }; -var genToc = function (toc, maxLevel) { - var tree = tocToTree(toc, maxLevel); +var genToc = function (toc, opts) { + var tree = Array.isArray(opts.sidebar) + ? opts.sidebar + : tocToTree(toc, opts['max-level']); + return buildHeadlinesTree(tree, '