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 選項: