Skip to content

Commit

Permalink
JSDoc
Browse files Browse the repository at this point in the history
  • Loading branch information
kunagpal committed Aug 28, 2016
1 parent 682a2f8 commit 32ecda6
Show file tree
Hide file tree
Showing 5 changed files with 83 additions and 3 deletions.
34 changes: 34 additions & 0 deletions .jsdoc-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"tags": {
"allowUnknownTags": true,
"dictionaries": ["jsdoc", "closure"]
},
"source": {
"include": [ ],
"includePattern": ".+\\.js(doc)?$",
"excludePattern": "(^|\\/|\\\\)_"
},

"plugins": [
"plugins/markdown"
],

"templates": {
"cleverLinks": false,
"monospaceLinks": false,
"highlightTutorialCode" : true
},

"opts": {
"template": "./node_modules/postman-jsdoc-theme",
"encoding": "utf8",
"destination": "./out/docs",
"recurse": true,
"readme": "README.md"
},

"markdown": {
"parser": "gfm",
"hardwrap": false
}
}
2 changes: 1 addition & 1 deletion lib/run/summary.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ proxyPropertyList = function (options, name) {
/**
* Transform object in variable-list JSON format
*
* @returns {[type]} [description]
* @returns {Object} [A JSON represented list of properties]
*/
toJSON: function () {
return {
Expand Down
16 changes: 16 additions & 0 deletions npm/build-docs.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/usr/bin/env node
// ---------------------------------------------------------------------------------------------------------------------
// This script is intended to generate documentation for this module
// ---------------------------------------------------------------------------------------------------------------------

require('shelljs/global');
require('colors');

// stop on encountering the first error
set('-e');
echo('-e', 'Generating documentation...');

test('-d', './out/docs') && rm('-rf', './out/docs');

exec('jsdoc -c .jsdoc-config.json -u lib/*;');
echo(' - documentation can be found at ./out/docs');
25 changes: 25 additions & 0 deletions npm/build-wiki.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/usr/bin/env node
// ---------------------------------------------------------------------------------------------------------------------
// This script is intended to generate a wiki for this module
// ---------------------------------------------------------------------------------------------------------------------

require('shelljs/global');
require('colors');

// stop on encountering the first error
set('-e');
echo('-e', 'Generating wiki...');
echo('-e', 'jsdoc2md');

// some variables
var OUT_DIR = 'out/wiki',
OUT_FILE = 'REFERENCE.md',
OUT_PATH = `${OUT_DIR}/${OUT_FILE}`;

// clean directory
test('-d', OUT_DIR) && rm('-rf', OUT_DIR);
mkdir('-p', OUT_DIR);

// execute command
exec(`jsdoc2md --src lib/**/*.js > ${OUT_PATH};`);
echo(` - wiki generated at ${OUT_PATH}\n`);
9 changes: 7 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@
"test-lint": "node npm/test-lint.js",
"test-unit": "node npm/test-unit.js",
"test-integration": "node npm/test-integration.js",
"test-cli": "node npm/test-cli.js"
"test-cli": "node npm/test-cli.js",
"build-docs": "node npm/build-docs.js",
"build-wiki": "node npm/build-wiki.js"
},
"author": "Postman Labs <[email protected]> (=)",
"license": "Apache-2.0",
Expand Down Expand Up @@ -62,9 +64,12 @@
"eslint-plugin-security": "1.2.0",
"expect.js": "0.3.1",
"js-yaml": "3.6.1",
"jsdoc": "3.4.0",
"jsdoc-to-markdown": "1.3.7",
"mocha": "3.0.2",
"nsp": "2.6.1",
"packity": "0.3.2"
"packity": "0.3.2",
"postman-jsdoc-theme": "0.0.2"
},
"engines": {
"node": ">=4"
Expand Down

0 comments on commit 32ecda6

Please sign in to comment.