•  


GitHub - Kotlin/dokka: API documentation engine for Kotlin
Skip to content

Kotlin/dokka

Repository files navigation

Dokka

Kotlin Beta JetBrains official project Maven Central Gradle Plugin License Revved up by Develocity

Dokka is an API documentation engine for Kotlin.

Just like Kotlin itself, Dokka supports mixed-language projects. It understands Kotlin's KDoc comments and Java's Javadoc comments .

Dokka can generate documentation in multiple formats, including its own modern HTML format , multiple flavors of Markdown , and Java's Javadoc HTML .

Some libraries that use Dokka for their API reference documentation:

You can run Dokka using Gradle , Maven or from the command line . It is also highly pluggable .

Documentation

Comprehensive documentation for Dokka is available on kotlinlang.org

Get started with Dokka

Gradle

Kotlin DSL

Apply the Gradle plugin for Dokka in the root build script of your project:

plugins {
    id(
"
org.jetbrains.dokka
"
) version 
"
1.9.20
"

}

When documenting multi-project builds, you need to apply the Gradle plugin for Dokka within subprojects as well:

subprojects {
    
apply
(plugin 
=
 "
org.jetbrains.dokka
"
)
}
Groovy DSL

Apply Gradle plugin for Dokka in the root project:

plugins {
    id 
'
org.jetbrains.dokka
'
 version 
'
1.9.20
'

}

When documenting multi-project builds, you need to apply the Gradle plugin for Dokka within subprojects as well:

subprojects {
    apply 
plugin
: 
'
org.jetbrains.dokka
'

}

To generate documentation, run the following Gradle tasks:

  • dokkaHtml for single-project builds
  • dokkaHtmlMultiModule for multi-project builds

By default, the output directory is set to /build/dokka/html and /build/dokka/htmlMultiModule respectively.

To learn more about the Gradle plugin for Dokka, see documentation for Gradle .

Maven

Add the Dokka Maven plugin to the plugins section of your POM file:

<
build
>
    <
plugins
>
        <
plugin
>
            <
groupId
>org.jetbrains.dokka</
groupId
>
            <
artifactId
>dokka-maven-plugin</
artifactId
>
            <
version
>1.9.20</
version
>
            <
executions
>
                <
execution
>
                    <
phase
>pre-site</
phase
>
                    <
goals
>
                        <
goal
>dokka</
goal
>
                    </
goals
>
                </
execution
>
            </
executions
>
        </
plugin
>
    </
plugins
>
</
build
>

To generate documentation, run the dokka:dokka goal.

By default, the output directory is set to target/dokka .

To learn more about using Dokka with Maven, see documentation for Maven .

CLI

It is possible to run Dokka from the command line without having to use any of the build tools, but it's more difficult to set up and for that reason it is not covered in this section.

Please consult documentation for the command line runner to learn how to use it.

Android

In addition to applying and configuring Dokka, you can apply Dokka's Android documentation plugin , which aims to improve documentation experience on the Android platform:

Gradle Kotlin DSL
dependencies {
    dokkaPlugin(
"
org.jetbrains.dokka:android-documentation-plugin:1.9.20
"
)
}
Gradle Groovy DSL
dependencies {
    dokkaPlugin 
'
org.jetbrains.dokka:android-documentation-plugin:1.9.20
'

}
Maven
<
plugin
>
    <
groupId
>org.jetbrains.dokka</
groupId
>
    <
artifactId
>dokka-maven-plugin</
artifactId
>
    ...
    <
configuration
>
        <
dokkaPlugins
>
            <
plugin
>
                <
groupId
>org.jetbrains.dokka</
groupId
>
                <
artifactId
>android-documentation-plugin</
artifactId
>
                <
version
>1.9.20</
version
>
            </
plugin
>
        </
dokkaPlugins
>
    </
configuration
>
</
plugin
>

Output formats

HTML

HTML is Dokka's default and recommended output format. You can see an example of the output by browsing documentation for kotlinx.coroutines .

HTML format is configurable and, among other things, allows you to modify stylesheets, add custom image assets, change footer message and revamp the structure of the generated HTML pages through templates.

For more details and examples, see documentation for HTML format .

Markdown

Dokka is able to generate documentation in GitHub Flavored and Jekyll compatible Markdown. However, both of these formats are still in Alpha, so you might encounter bugs and migration issues.

For more details and examples, see documentation for Markdown formats .

Javadoc

Dokka's Javadoc output format is a lookalike of Java's Javadoc HTML format . This format is still in Alpha, so you might encounter bugs and migration issues.

Javadoc format tries to visually mimic HTML pages generated by the Javadoc tool, but it's not a direct implementation or an exact copy. In addition, all Kotlin signatures are translated to Java signatures.

For more details and examples, see documentation for Javadoc format .

Dokka plugins

Dokka was built from the ground up to be easily extensible and highly customizable, which allows the community to implement plugins for missing or very specific features that are not provided out of the box.

Learn more about Dokka plugins and their configuration in Dokka plugins .

If you want to learn how to develop Dokka plugins, see Developer guides .

Community

Dokka has a dedicated #dokka channel in Kotlin Community Slack where you can chat about Dokka, its plugins and how to develop them, as well as get in touch with maintainers.

Building and Contributing

See Contributing Guidelines

- "漢字路" 한글한자자동변환 서비스는 교육부 고전문헌국역지원사업의 지원으로 구축되었습니다.
- "漢字路" 한글한자자동변환 서비스는 전통문화연구회 "울산대학교한국어처리연구실 옥철영(IT융합전공)교수팀"에서 개발한 한글한자자동변환기를 바탕하여 지속적으로 공동 연구 개발하고 있는 서비스입니다.
- 현재 고유명사(인명, 지명등)을 비롯한 여러 변환오류가 있으며 이를 해결하고자 많은 연구 개발을 진행하고자 하고 있습니다. 이를 인지하시고 다른 곳에서 인용시 한자 변환 결과를 한번 더 검토하시고 사용해 주시기 바랍니다.
- 변환오류 및 건의,문의사항은 juntong@juntong.or.kr로 메일로 보내주시면 감사하겠습니다. .
Copyright ⓒ 2020 By '전통문화연구회(傳統文化硏究會)' All Rights reserved.
 한국   대만   중국   일본