Skip to content

模块文档

整个模块以及该模块中的包的文档可以作为单独的 Markdown 文件提供。

文件格式

在 Markdown 文件中,整个模块和单个包的文档由相应的一级标题引入。模块的标题文本必须Module <module name>,包的标题文本必须Package <package qualified name>

该文件不必同时包含模块和包的文档。你可以只包含包或模块文档的文件。你甚至可以为每个模块或包创建一个 Markdown 文件。

使用 Markdown 语法,你可以添加:

  • 标题(最多六级)
  • 粗体或斜体格式的强调
  • 链接
  • 内联代码
  • 代码块
  • 引用块

这是一个包含模块和包文档的示例文件:

text
# Module kotlin-demo

This content appears under your module name.

# Package org.jetbrains.kotlin.demo

This content appears under your package name in the packages list.
It also appears under the first-level heading on your package's page.

## Level 2 heading for package org.jetbrains.kotlin.demo

Content after this heading is also part of documentation for `org.jetbrains.kotlin.demo`

# Package org.jetbrains.kotlin.demo2

This content appears under your package name in the packages list.
It also appears under the first-level heading on your package's page.

## Level 2 heading for package org.jetbrains.kotlin.demo2

Content after this heading is also part of documentation for `org.jetbrains.kotlin.demo2`

要查看一个使用 Gradle 的示例项目,请参阅 Dokka Gradle 示例

将文件传递给 Dokka

要将这些文件传递给 Dokka,你需要为 Gradle、Maven 或 CLI 使用相关的 includes 选项: