简体   繁体   English

Typedoc:仅记录特定文件导出的内容

[英]Typedoc: document only things exported by a specific file

I am developing two npn packages:我正在开发两个 npn 包:

I want to document them by using typedoc.我想使用 typedoc 来记录它们。 The index.js file is the one provided by the npm module and is obtained by index.ts. index.js 文件是 npm 模块提供的文件,通过 index.ts 获取。

I want to document only what is exported by the library index.ts.我只想记录库 index.ts 导出的内容。 I can filter the non-exported things with the typedoc options.我可以使用 typedoc 选项过滤未导出的内容。

The problem is that the index.ts import things from other TS files and export only some of them.问题是 index.ts 从其他 TS 文件中导入东西,只导出其中的一些。 For instance, it imports and re-exports some interfaces from the interfaces/index.ts and the errors classes from errors/index.ts, but imports without exporting the class Database from the utils/database/index.ts.例如,它从interfaces/index.ts 导入和重新导出一些接口,从errors/index.ts 导入和重新导出错误类,但导入而不从utils/database/index.ts 导出类Database。

Being actually exported, things such that Database class are documented even if they are exported by a file different from index.ts.在实际导出时,即使数据库类是由不同于 index.ts 的文件导出的,也会被记录下来。

How can I filter them?我怎样才能过滤它们?

The current @next version of typedoc has a --library mode.当前的 @next 版本的 typedoc 有一个 --library 模式。 Seems that there are going to be big changes with the @beta version and the future 1.0.0 version, where the mode option will even disappear.似乎@beta 版本和未来的 1.0.0 版本会有很大的变化,模式选项甚至会消失。 Development seems to proceed extremely slow, so I think that the only way now is to use the (probably bugged) @next and @beta versions and wait.开发似乎进行得非常缓慢,所以我认为现在唯一的方法是使用(可能有问题)@next 和 @beta 版本并等待。

Edit: the 0.20.x is no more beta and has been released, it works good, so the problem is solved编辑:0.20.x 不再是测试版,已经发布,效果很好,所以问题解决了

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM