如何在jsDoc示例中使用多行注释?
/** * @example * * a.setConnection(/* connection details here */); * */
引擎似乎根本不喜欢这样的代码。我试过使用HTML特殊符号,比如 +* connection details here *+
+* connection details here *+
我们怎样才能让它起作用?
正如我自己发现的,内部jsDoc不支持特殊符号 @example 封锁。它们只在内联代码块中工作,如下所示:
@example
```js a.setConnection(/* connection details here */); ```
输出: a.setConnection(/* connection details here */);
a.setConnection(/* connection details here */);
,不能将内联代码块放在所有内容之后,因为它是内联的,这意味着它将位于 @returns 章节。
@returns
很尴尬,我知道,但别无选择。