diff --git a/index.js b/index.js index b73ea6b..9f6aa98 100755 --- a/index.js +++ b/index.js @@ -23,6 +23,7 @@ function docdown(options) { 'lang': 'js', 'sort': true, 'title': path.basename(options.path) + ' API documentation', + 'sort': true, 'toc': 'properties' }); diff --git a/lib/generator.js b/lib/generator.js index 0b4bbc1..6810e8f 100644 --- a/lib/generator.js +++ b/lib/generator.js @@ -267,7 +267,7 @@ function generateDoc(source, options) { // Sort categories and add special categories back. if (sortEntries) { - tocGroups.sort(util.compareNatural); + if (sortEntries) tocGroups.sort(util.compareNatural); } push.apply(tocGroups, catogoriesUsed); } @@ -354,4 +354,4 @@ function generateDoc(source, options) { return docMarkdown.join('\n'); } -module.exports = generateDoc; +module.exports = generateDoc; \ No newline at end of file