KDoc语法

与JavaDoc类似,KDoc注释以/**开始并以 */结束。注释的每一行可以以一个星号开头,星号不会作为注释的一部分。

按照惯例,文档内容的第一个段落是对元素的总结描述,接下来的内容是细节描述。

每个块标签需要换行并且以@字符开头。

/**
* A group of *members*.
*
* This class has no useful logic; it's just a documentation example.
*
* @param T the type of a member in this group.
* @property name the name of this group.
* @constructor Creates an empty group.
*/
class Group<T>(val name: String) {
    /**
     * Adds a [member] to this group.
     * @return the new size of the group.
     */
     fun add(member: T): Int { ... }
}

results matching ""

    No results matching ""