从JSDOC评论中导出结构化JS/JSON的任何标准方法
我想在交互式组件中使用JavaScript文件中的JSDOC注释(例如出现在Hover上的属性定义),但是我找不到这样做的方法,因为JSDOC主要打算导出HTML文件。
是否有一种直接的方法可以将文件从文件中解析为结构化数据,然后我可以在UI中消耗这些数据?
I want to use jsdoc comments from a javascript file inside an interactive component (like property definitions appearing on hover), but I can’t find a way to do that as jsdoc is primarily intended to export html files.
Is there a straightforward way to parse jsdoc comments from a file as structured data that I can then consume in my UI?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
可能是最常见的用例,但绝对不是唯一的用例。
我个人从不使用JSDOC本身生成文档。我使用
-x
选项,然后 jq 改变解析树。示例:index.js
Probably the most common use case but definitely not the only one.
I personally never use JSDoc itself to generate documentation. I use the
-X
option then jq to transform the parse tree.Example: index.js