What does @code mean in Google Closure?

女生的网名这么多〃 提交于 2019-12-24 01:44:23

问题


An example is here:

* 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

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 :)


回答1:


Updated

Per my new understanding; Since JSDocs supports markdown. {@code FooBar} is therefore deprecated in favor of back-ticks `FooBar`.

Old

You can see the output of the docs you've asked about on the Closure API's documentation page for goog.events.EventTarget.

When the JSDocs are rendered the @code tag will cause the code with in brackets to be rendered with as a <code></code> element.

Source: js-dossier

There's also the much better documentation from the JavaDocs... docs:

{@code text}

  • Equivalent to {@literal}.

  • 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}
    

    displays in the generated HTML page unchanged, as:

    A<B>C
    

    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}.

Source: docs.oracle.com



来源:https://stackoverflow.com/questions/39862968/what-does-code-mean-in-google-closure

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!