jsdoc 未解析 <script>
内容(有效的 JS 和有效的 JSDOC 注释)。
如何解决?
是否可以扫描 script 标签内的 html 文件和文档代码?
jsdoc: {
dist: {
src: ['assets/js/**/*.js', 'templates/users/*.html', 'README.md'],
options: {
destination: '.dev/jsdoc',
template: 'node_modules/ink-docstrap/template',
configure: '.jsdoc.conf.json'
}
}
},
.jsdoc.conf.json
{
"tags": {
"allowUnknownTags": true
},
"plugins": ["plugins/markdown"],
"templates": {
"logoFile": "",
"cleverLinks": false,
"monospaceLinks": false,
"dateFormat": "ddd MMM Do YYYY",
"outputSourceFiles": true,
"outputSourcePath": true,
"systemName": "Django",
"footer": "",
"copyright": "DocStrap Copyright © 2012-2015 The contributors to the JSDoc3 and DocStrap projects.",
"navType": "vertical",
"theme": "readable",
"linenums": true,
"collapseSymbols": false,
"inverseNav": true,
"protocol": "html://",
"methodHeadingReturns": false
},
"markdown": {
"parser": "gfm",
"hardwrap": true
},
"opts": {
"sort": false
}
}
最佳答案
如果你查看这个问题:https://github.com/jsdoc3/jsdoc/issues/721 jsdoc 不支持此功能。不过,有一个插件可以实现在拉取请求中解析 HTML 文件:https://github.com/jsdoc3/jsdoc/pull/723
关于gruntjs - 如何处理 html 模板中的 javascript 代码 (jsdoc/grunt-jsdoc),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35999832/