首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何处理html模板中的javascript代码(jsdoc / grunt-jsdoc)

如何处理html模板中的javascript代码(jsdoc / grunt-jsdoc)
EN

Stack Overflow用户
提问于 2016-03-14 23:13:26
回答 1查看 399关注 0票数 2

jsdoc没有解析<script>内容(带有有效JSDOC注释的有效JS )。

如何修复?

是否可以扫描脚本标记中的html文件和文档代码?

代码语言:javascript
复制
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

代码语言:javascript
复制
{
  "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
  }
}
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2016-07-19 09:01:05

如果您查看问题:https://github.com/jsdoc3/jsdoc/issues/721,jsdoc不支持这个问题。但是,在拉请求中有一个插件可以实现对HTML的解析:https://github.com/jsdoc3/jsdoc/pull/723

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/35999832

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档