Use explicit --access=public. Fixes #213

This commit is contained in:
Tom MacWright 2016-05-20 16:49:16 -04:00
parent bb41619c73
commit 4dab786a39
7 changed files with 182 additions and 31 deletions

View File

@ -57,7 +57,6 @@ function expandInputs(indexes, options, callback) {
* Generate JavaScript documentation as a list of parsed JSDoc
* comments, given a root file as a path.
*
* @alias documentation
* @param {Array<string>|string} indexes files to process
* @param {Object} options options
* @param {Array<string>} options.external a string regex / glob match pattern
@ -78,8 +77,9 @@ function expandInputs(indexes, options, callback) {
* @param {Function} callback to be called when the documentation generation
* is complete, with (err, result) argumentsj
* @returns {undefined} calls callback
* @public
*/
module.exports = function (indexes, options, callback) {
module.exports.build = function (indexes, options, callback) {
options = options || {};
options.hljs = options.hljs || {};
@ -143,6 +143,7 @@ module.exports = function (indexes, options, callback) {
* @param {Function} callback to be called when the documentation generation
* is complete, with (err, result) argumentsj
* @returns {undefined} calls callback
* @public
*/
module.exports.lint = function lint(indexes, options, callback) {
options = options || {};

View File

@ -50,7 +50,7 @@ function build(documentation, parsedArgs, callback) {
hljs: options.hljs || {}
};
var generator = documentation.bind(null, inputs, options, onDocumented);
var generator = documentation.build.bind(null, inputs, options, onDocumented);
function onDocumented(err, comments) {
if (err) {

View File

@ -77,7 +77,7 @@
},
"scripts": {
"lint": "eslint bin lib index.js test",
"doc": "documentation index.js -f md > docs/NODE_API.md",
"doc": "documentation index.js -f md --access=public > docs/NODE_API.md",
"test": "npm run lint && tap -t 120 --coverage test/*.js test/lib test/streams"
}
}

View File

@ -9,7 +9,9 @@ function addOne(a) {
/**
* This function returns the number one. Internally, this uses
* {@link addOne} to do the math.
* {@link addOne} to do the math. This demonstrates
* {@link https://en.wikipedia.org/wiki/Addition Addition}
* and {@link https://en.wikipedia.org/wiki/Addition}
* @param {number} a the input
* @returns {number} numberone
*/

View File

@ -94,7 +94,7 @@
"column": 1
}
},
"code": "/**\n * Adds one to a number\n * @param {number} a the input\n * @returns {number} the output\n */\nfunction addOne(a) {\n return a + 1;\n}\n\n/**\n * This function returns the number one. Internally, this uses\n * {@link addOne} to do the math.\n * @param {number} a the input\n * @returns {number} numberone\n */\nmodule.exports = function (a) {\n return addOne(a);\n};\n"
"code": "/**\n * Adds one to a number\n * @param {number} a the input\n * @returns {number} the output\n */\nfunction addOne(a) {\n return a + 1;\n}\n\n/**\n * This function returns the number one. Internally, this uses\n * {@link addOne} to do the math. This demonstrates\n * {@link https://en.wikipedia.org/wiki/Addition Addition}\n * and {@link https://en.wikipedia.org/wiki/Addition}\n * @param {number} a the input\n * @returns {number} numberone\n */\nmodule.exports = function (a) {\n return addOne(a);\n};\n"
},
"errors": [],
"params": [
@ -286,7 +286,7 @@
},
{
"type": "text",
"value": " to do the math.",
"value": " to do the math. This demonstrates\n",
"position": {
"start": {
"line": 2,
@ -294,9 +294,80 @@
"offset": 74
},
"end": {
"line": 2,
"column": 31,
"offset": 90
"line": 3,
"column": 1,
"offset": 109
},
"indent": [
1
]
}
},
{
"type": "link",
"url": "https://en.wikipedia.org/wiki/Addition",
"title": null,
"jsdoc": true,
"children": [
{
"type": "text",
"value": "Addition"
}
],
"position": {
"start": {
"line": 3,
"column": 1,
"offset": 109
},
"end": {
"line": 3,
"column": 56,
"offset": 164
},
"indent": []
}
},
{
"type": "text",
"value": "\nand ",
"position": {
"start": {
"line": 3,
"column": 56,
"offset": 164
},
"end": {
"line": 4,
"column": 5,
"offset": 169
},
"indent": [
1
]
}
},
{
"type": "link",
"url": "https://en.wikipedia.org/wiki/Addition",
"title": null,
"jsdoc": true,
"children": [
{
"type": "text",
"value": "https://en.wikipedia.org/wiki/Addition"
}
],
"position": {
"start": {
"line": 4,
"column": 5,
"offset": 169
},
"end": {
"line": 4,
"column": 51,
"offset": 215
},
"indent": []
}
@ -309,11 +380,13 @@
"offset": 0
},
"end": {
"line": 2,
"column": 31,
"offset": 90
"line": 4,
"column": 51,
"offset": 215
},
"indent": [
1,
1,
1
]
}
@ -326,9 +399,9 @@
"offset": 0
},
"end": {
"line": 2,
"column": 31,
"offset": 90
"line": 4,
"column": 51,
"offset": 215
}
}
},
@ -336,7 +409,7 @@
{
"title": "param",
"description": "the input",
"lineNumber": 3,
"lineNumber": 5,
"type": {
"type": "NameExpression",
"name": "number"
@ -346,7 +419,7 @@
{
"title": "returns",
"description": "numberone",
"lineNumber": 4,
"lineNumber": 6,
"type": {
"type": "NameExpression",
"name": "number"
@ -359,28 +432,28 @@
"column": 0
},
"end": {
"line": 15,
"line": 17,
"column": 3
}
},
"context": {
"loc": {
"start": {
"line": 16,
"line": 18,
"column": 0
},
"end": {
"line": 18,
"line": 20,
"column": 2
}
},
"code": "/**\n * Adds one to a number\n * @param {number} a the input\n * @returns {number} the output\n */\nfunction addOne(a) {\n return a + 1;\n}\n\n/**\n * This function returns the number one. Internally, this uses\n * {@link addOne} to do the math.\n * @param {number} a the input\n * @returns {number} numberone\n */\nmodule.exports = function (a) {\n return addOne(a);\n};\n"
"code": "/**\n * Adds one to a number\n * @param {number} a the input\n * @returns {number} the output\n */\nfunction addOne(a) {\n return a + 1;\n}\n\n/**\n * This function returns the number one. Internally, this uses\n * {@link addOne} to do the math. This demonstrates\n * {@link https://en.wikipedia.org/wiki/Addition Addition}\n * and {@link https://en.wikipedia.org/wiki/Addition}\n * @param {number} a the input\n * @returns {number} numberone\n */\nmodule.exports = function (a) {\n return addOne(a);\n};\n"
},
"errors": [],
"params": [
{
"name": "a",
"lineNumber": 3,
"lineNumber": 5,
"description": {
"type": "root",
"children": [

View File

@ -11,7 +11,9 @@ Returns **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refer
# inline-link.input
This function returns the number one. Internally, this uses
[addOne](addOne) to do the math.
[addOne](addOne) to do the math. This demonstrates
[Addition](https://en.wikipedia.org/wiki/Addition)
and <https://en.wikipedia.org/wiki/Addition>
**Parameters**

View File

@ -257,7 +257,7 @@
},
{
"type": "text",
"value": " to do the math.",
"value": " to do the math. This demonstrates\n",
"position": {
"start": {
"line": 2,
@ -265,9 +265,80 @@
"offset": 74
},
"end": {
"line": 2,
"column": 31,
"offset": 90
"line": 3,
"column": 1,
"offset": 109
},
"indent": [
1
]
}
},
{
"type": "link",
"url": "https://en.wikipedia.org/wiki/Addition",
"title": null,
"jsdoc": true,
"children": [
{
"type": "text",
"value": "Addition"
}
],
"position": {
"start": {
"line": 3,
"column": 1,
"offset": 109
},
"end": {
"line": 3,
"column": 56,
"offset": 164
},
"indent": []
}
},
{
"type": "text",
"value": "\nand ",
"position": {
"start": {
"line": 3,
"column": 56,
"offset": 164
},
"end": {
"line": 4,
"column": 5,
"offset": 169
},
"indent": [
1
]
}
},
{
"type": "link",
"url": "https://en.wikipedia.org/wiki/Addition",
"title": null,
"jsdoc": true,
"children": [
{
"type": "text",
"value": "https://en.wikipedia.org/wiki/Addition"
}
],
"position": {
"start": {
"line": 4,
"column": 5,
"offset": 169
},
"end": {
"line": 4,
"column": 51,
"offset": 215
},
"indent": []
}
@ -280,11 +351,13 @@
"offset": 0
},
"end": {
"line": 2,
"column": 31,
"offset": 90
"line": 4,
"column": 51,
"offset": 215
},
"indent": [
1,
1,
1
]
}