我正在编写文档注释来描述一种方法。
/**
* <p>necessary
* <p>setType is to set the PendingIntend's request code</p>
*/
但它不会显示段落。如果我不使用 <p>
,所有文档都在一行中,没有任何中断。
它适用于 Java 类,但谈到 Kotlin,我不知道如何处理它。
最佳答案
如 documentation 中所述, KDoc(相当于 Kotlin 中的 Java 的 JavaDoc)使用常规的 Markdown syntax用于内联标记而不是 HTML 标记。
在 Markdown 中,段落只是用空行分隔,如下所示:
/**
* necessary
*
* setType is to set the PendingIntend's request code
*/
另外,请参阅 this example在 Kotlin 引用资料中。
关于android - Kotlin 文档不支持像 '<p>' 这样的标签,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34632070/