使用TypeDoc链接到外部库文档 [英] Linking to external library documentation with TypeDoc
问题描述
我有一个TypeScript项目,并且正在使用TypeDoc为其生成文档.在我的项目中,我使用的是具有自己现有文档的外部库.在我的项目的TypeDoc输出中,我希望将阅读器链接到外部库的文档,而无需手动插入URL.
I have a TypeScript project, and I'm using TypeDoc to generate documentation for it. In my project I am using an external library that has its own existing documentation. In the TypeDoc output for my project I want to link the reader to the documentation for the external library without having to manually insert a URL.
最接近解决方案的地方是,在代码注释中将双括号放在要链接的内容周围,如下所示:
The closest I've come to a solution is placing double brackets in the code comments around what I want to link to, like this:
/** I want to link to something called [[Foo]] */
但这似乎不适用于外部库中的类型.
But this doesn't seem to work for types in an external library.
这有可能实现吗?
推荐答案
是的,您可以使用以下语法,方法是将文本放在方括号[]
之间,并将网址放在括号()
之间.
Yes you can use following syntax by putting text between square brackets []
and url between parenthesis ()
.
[Text to be displayed](URL)
例如:链接到名为pg-structure
的npm
模块.
For example: Link to an npm
module called pg-structure
.
[pg-structure](https://www.npmjs.com/package/pg-structure)
我通常也通过从左侧的npm
链接图标复制来链接到相关段落. (请参见下面示例图片中Synopsis
标题左侧的图标)
I also usually link to related paragraph by copying from npm
link icon left to title. (See icon left to Synopsis
title in example picture below)
这篇关于使用TypeDoc链接到外部库文档的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!