@code在Google Closure中是什么意思? [英] What does @code mean in Google Closure?
问题描述
一个例子在这里:
* An implementation of {@code goog.events.Listenable} with full W3C
* EventTarget-like support (capture/bubble mechanism,
https://developer.pubref.org/static/apidoc/global/closure/goog/events/EventTarget.html
我可以猜出这是什么意思,但是在哪里可以找到它的确切定义?我检查了所有的Google Closure Annotation文档,但找不到.谢谢:)
I can guess what it means but where can I find its exact definition? I checked all the Google Closure Annotation docs but couldn't find. Thanks :)
推荐答案
已更新
根据我的新理解;由于JSDocs支持markdown.因此,不推荐使用{@code FooBar},而推荐使用反引号`FooBar`
.
您可以在针对goog.events.EventTarget 的Closure API文档页面.
You can see the output of the docs you've asked about on the Closure API's documentation page for goog.events.EventTarget.
呈现JSDocs时,@ code标记将使括号中的代码呈现为<code></code>
元素.
When the JSDocs are rendered the @code tag will cause the code with in brackets to be rendered with as a <code></code>
element.
来源: js-dossier
JavaDocs中还有更好的文档... docs:
There's also the much better documentation from the JavaDocs... docs:
{@ code text}
-
等同于
{@literal}
.
以代码字体显示文本,而不将文本解释为HTML标记或嵌套的Javadoc标记.这使您可以在文档注释中使用常规尖括号(<和>)而不是HTML实体(<和>),例如参数类型(),不等式(3< 4)或箭头(<< ;-).例如,文档注释文本:
Displays text in code font without interpreting the text as HTML markup or nested javadoc tags. This enables you to use regular angle brackets (< and >) instead of the HTML entities (< and >) in doc comments, such as in parameter types (), inequalities (3 < 4), or arrows (<-). For example, the doc comment text:
{@code A<B>C}
不变显示在生成的HTML页面中,如下所示:
displays in the generated HTML page unchanged, as:
A<B>C
值得注意的一点是,不会解释为粗体,而是使用代码字体. 如果您想要没有代码字体的相同功能,请使用{@literal}.
The noteworthy point is that the is not interpreted as bold and is in code font. If you want the same functionality without the code font, use {@literal}.
来源: docs.oracle.com
这篇关于@code在Google Closure中是什么意思?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!