diff --git a/README.md b/README.md index c84ae51..808a169 100644 --- a/README.md +++ b/README.md @@ -67,7 +67,8 @@ In your `.jsdoc.json` file, add a template option. "cleverLinks": false, "monospaceLinks": true, "useLongnameInNav": false, - "showInheritedInNav": true + "showInheritedInNav": true, + "sort": true, }, "opts": { "destination": "./docs/", diff --git a/publish.js b/publish.js index 0eefeda..48b3a41 100644 --- a/publish.js +++ b/publish.js @@ -529,7 +529,15 @@ exports.publish = function(taffyData, opts, tutorials) { // set up tutorials for helper helper.setTutorials(tutorials) data = helper.prune(data) - data.sort("longname, version, since") + + if(opts.sort && (typeof opts.sort == 'string' || typeof opts.sort == 'boolean')){ + var sortOrder = "longname, version, since" + if(typeof opts.sort == 'string'){ + sortOrder = opts.sort + } + data.sort(sortOrder) + } + helper.addEventListeners(data) var sourceFiles = {}