路径中的jsdoc命名空间

时间:2019-05-09 20:19:28

标签: jsdoc

示例;

> find . -iname '*.js'
./a/a.js
./b/a.js

> cat a/a.js
function a(b){
    return "a" + b;
}

> cat b/a.js
function a(b){
    return "b" + b;
}

> jsdoc -a -s -d=doc -s $(find . -iname '*.js')
java -Djsdoc.template.dir=/usr/share/jsdoc-toolkit/templates/jsdoc -jar /usr/share/java/jsrun.jar /usr/share/jsdoc-toolkit/app/run.js -a -s -d=doc -s ./a/a.js ./b/a.js
>> WARNING: Overwriting symbol documentation for: a.
1 warning.

> grep "Defined in" doc/symbols/_global_.html 
                            <i>Defined in: </i> &lt;./b/a.js&gt;.

> apt show jsdoc-toolkit | grep Version
Version: 2.4.0+dfsg-6

假设一个人故意在不同的窗口中使用具有相同名称的函数,那么如何防止名称空间冲突?

我尝试了@module @namespace @fileOverview @typedef的各种组合

3.6.1中的类似问题

jsdoc -d doc $(find . -iname '*.js')
ERROR: Unable to parse a/a.js: Identifier 'a' has already been declared (7:4)

> jsdoc -h | grep "JSDoc "
JSDoc 3.6.1 (Sun, 05 May 2019 19:24:09 GMT)

0 个答案:

没有答案