【发布时间】:2020-11-11 22:23:54
【问题描述】:
我正在使用 stencil.js 创建一个 Web 组件库。我想利用 docs-readme 输出功能,但必须对实际将哪些 cmets 输出到文档中进行大量试验和错误。
我现在遇到的具体问题是我无法获取组件本身的文档以使用自述文件生成。例如:
/**
* This is a description of the component that I would like to generate in the readme.md for MyComponent
*/
@Component({
tag: 'my-component',
styleUrl: 'my-component.css',
shadow: true,
})
/** I've also tried this comment style and this location, but no dice */
export class MyComponent {
...
}
根据jsdoc documentation,似乎我应该能够记录课程,但似乎没有任何效果。是否有一份详尽的清单,列出了 Stencil 会和不会实际生成文档的内容?
【问题讨论】:
-
也许可以看看github.com/ionic-team/ionic-framework/blob/master/core/src/… 为例,以及生成的自述文件:raw.githubusercontent.com/ionic-team/ionic-framework/master/…。如您所见,主要组件描述不是自动生成内容的一部分,因此我不确定您是否可以像尝试使用组件类的 jsdoc 注释那样将该部分内联到您的代码中。
-
我知道没有关于此的文档,但您可以单击自己的源代码以了解 stencil 究竟选择了什么。这是起点:github.com/ionic-team/stencil/blob/…。