dokka is a free, open source documentation & knowledge base project written in Kotlin and released under Apache-2.0. It has 3,817 GitHub stars, 504 forks and 675 open issues, and was last pushed 15 days ago. On this registry it ranks #38 of 100 tracked projects in Documentation & Knowledge Base, with 5 head-to-head comparisons available. It gained 7 stars over the last 30 tracked days.

What is dokka?

Dokka is JetBrains' open-source API documentation engine for Kotlin, the tool that turns KDoc and Javadoc comments into publishable HTML and Markdown API reference sites for Kotlin, Java, and mixed-language codebases.

What it is

Dokka is an API documentation engine for Kotlin, maintained by JetBrains as an official project and distributed under the Apache-2.0 licence. Just like Kotlin itself, it supports mixed-language projects: it understands Kotlin's KDoc comments and Java's Javadoc comments, so a codebase that mixes both languages produces one coherent reference instead of two disconnected ones. Output is available in several formats, including Dokka's own modern HTML format, multiple flavors of Markdown, and Java's Javadoc HTML. The engine is highly pluggable, and the comprehensive documentation lives on kotlinlang.org rather than in the repository alone.

The concrete problem it solves is the gap between source comments and a usable reference site for Kotlin code. The specific thing it replaces is hand-maintained or Javadoc-only API documentation: Javadoc does not understand KDoc syntax, so Kotlin projects previously had to write reference docs by hand or accept output that discarded most of their comment content. Dokka reads the comments developers already write and turns them into a structured, navigable site.

Key capabilities

  • Parses Kotlin KDoc and Java Javadoc comment syntax in the same build, so mixed-language modules generate unified output.
  • Generates Dokka's modern HTML format, multiple flavors of Markdown, and Java-compatible Javadoc HTML.
  • Applies as the Gradle plugin org.jetbrains.dokka version 2.2.0, published on Maven Central as org.jetbrains.dokka:dokka-gradle-plugin and on the Gradle Plugin Portal.
  • Integrates with Maven through org.jetbrains.dokka:dokka-maven-plugin version 2.2.0, bound to the pre-site phase and invoked with the dokka:dokka goal.
  • Runs standalone through a command-line runner for builds that use neither Gradle nor Maven.
  • Provides dokkaHtml for single-project builds and dokkaHtmlMultiModule for multi-project builds, writing to /build/dokka/html and /build/dokka/htmlMultiModule by default.
  • Highly pluggable, so processing and output can be extended past the bundled formats.

Who uses it and how

  • Library maintainers publish API reference for widely consumed Kotlin artifacts; kotlinx.coroutines, Ktor, OkHttp, Hexagon, and Bitmovin all ship Dokka-generated documentation.
  • Gradle uses Dokka to publish reference for its Kotlin DSL, an example of output generated from a large multi-module build.
  • Multi-project builds apply the plugin in the root build script and again in each subproject, then run dokkaHtmlMultiModule to produce one combined site.
  • Maven projects bind the plugin to the pre-site phase so API documentation regenerates as part of the normal site build.
  • Teams needing full control over invocation can use the command-line runner instead of a build plugin.

Getting started

The standard path applies the Gradle plugin org.jetbrains.dokka version 2.2.0 and runs dokkaHtml; Maven users add org.jetbrains.dokka:dokka-maven-plugin version 2.2.0 and run the dokka:dokka goal.

How it compares

No comparable tool is named in the facts for this entry, so Dokka stands alone in this registry among API documentation engines. It is not positioned here against any named alternative, paid or free.

When to use it — and when not to

Choose Dokka when the codebase is Kotlin, or a Kotlin and Java mix, and the goal is published API reference built from comments already in the source. The command-line path is explicitly harder to set up than the Gradle or Maven plugins, so teams without a JVM build tool should expect extra configuration work. The project is marked Kotlin Beta and the repository carries 675 open issues, so adopters should expect movement in APIs and output rather than a frozen surface.

project readme (upstream, from github) — read inline

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 "2.2.0"
}

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 '2.2.0'
}

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>2.2.0</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:2.2.0")
}
Gradle Groovy DSL
dependencies {
    dokkaPlugin 'org.jetbrains.dokka:android-documentation-plugin:2.2.0'
}
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>2.2.0</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.

Dokka allows you to extend its functionality by configuring custom plugins, which enable additional processing or modifications to the documentation generation process.

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

Frequently asked questions

Is dokka free to use?

dokka is open source under the Apache-2.0 licence. There is no licence fee and no seat count — you can self-host it or, where the project offers one, pay a vendor for a managed version instead.

What does dokka do?

API documentation engine for Kotlin

What is dokka written in?

dokka is primarily written in Kotlin. Its source is publicly available at https://github.com/Kotlin/dokka, and it has 3,817 GitHub stars.