更新时间:2023-12-05 19:04:16
当你写这个
function bar (foo) {
return foo + foo;
}
如果将光标放在上方的行中函数
并且当你按«Enter»时你写 / **
你会得到这个:
If you place your cursor in the line just above function
and you write /**
when you push « Enter » you'll be obtain this:
/**
* [bar description]
* @param {[type]} foo [description]
* @return {[type]} [description]
*/
function bar (foo) {
return foo + foo;
}
有很多类似的短片。
例如,如果将光标放在 @param {[type]} foo [description]
之后,按«Enter»将创建一个新的 *
行,并写 @
将建议您(在intellisense中)所有JSDoc注释并验证创建一个完整的行。
For exemple, if you place your cursor after @param {[type]} foo [description]
, push « Enter » will create a new a *
line, and write @
will propose you (in the intellisense) all JSDoc comments and the validation create a full line.
正确记录文件后,只需使用 jsdoc
CLI创建文档。
When your file is correctly documented, just use the jsdoc
CLI to create your documentation.
编辑:我刚刚意识到你的问题的答案在你的 https: //github.com/spadgos/sublime-jsdocs 链接所以也许你想知道如何生成文档...
I just realize the response to your question is in your https://github.com/spadgos/sublime-jsdocs link so maybe you want know how generate the documentation so...
安装Node.js并使用CLI命令
Install Node.js and use CLI command
npm install jsdoc -g
n,你想要文件的假定文件名是 foo.js
,运行以下命令:
Then, supposed file name you want document is foo.js
, run the following command:
jsdoc foo.js
这将创建的文档out
目录。
生成doc的所有CLI文档都在这里: http://usejsdoc.org/about-commandline.html
All CLI documentation to generate doc is here : http://usejsdoc.org/about-commandline.html