我如何记录这个小部件,以便工具包可以公开方法和选项。
我尝试过的一切都不会在封闭内看到任何东西。
/**
* @fileOverview
* @version 1.0
*/
(function($) {
"use strict";
$.widget('mynamespace.nameofwidget', {
// foo should show up in the docs
options: {
'foo': 'bar'
},
// public function name and parameters should be documented
myPublic function () {
// code here....
},
// private function no need to document
_create: function () {
// code here....
},
// private function no need to document
_setOption: function (key, value) {
// code here....
},
});
})(jQuery);
[编辑]
这是我的配置文件
{
// source files to use
_: ['js/test/'],
// document all functions, even uncommented ones
a: true,
// including those marked @private
p: true,
// use this directory as the output directory
d: "js/docs/",
// use this template
t: "jsdoc-toolkit/templates/jsdoc",
}
这是我正在使用的命令行命令。
java -jar jsdoc-toolkit/jsrun.jar jsdoc-toolkit/app/run.js -c=js/docs/conf/ilo.conf
[更新配置]
{
"opts": {
"destination": "../js/out/",
"private": true
},
"tags": {
"allowUnknownTags": true
},
"source": {
"include": [ "../js/test" ],
"includePattern": ".+\\.js(doc)?$",
"excludePattern": "(^|\\/|\\\\)_"
},
"plugins": [],
"templates": {
"cleverLinks": false,
"monospaceLinks": false,
"default": {
"outputSourceFiles": true
}
}
}