github Kotlin/dokka v2.1.0
2.1.0-Beta

pre-release9 days ago

Dokka's Gradle plugin v2 is enabled by default!

Please check the migration guide for the update procedure

Dokka 2.0.0 introduced a significantly improved Gradle plugin v2, and with Dokka 2.1.0-Beta it is now enabled by default!
As a result, all types and Gradle tasks related to Dokka Gradle plugin v1 are deprecated and will be removed in future releases.
Running Gradle tasks related to Dokka Gradle plugin v1 will result in an error during execution.

Starting from this release, the minimum supported Gradle version is 7.6.3.

Other fixes and improvements

  • Update Gradle Properties types to be non-nullable (#4136)
  • Update displayName convention for DokkaSourceSets (#4142)
  • Update olderVersionsDir to be an optional input. (#4155)
  • Add lifecycle tasks for generating formats (#4141)
  • Use project name as default modulePath for root project to avoid clashing outputs during aggregation (#4158)
  • Remove Dokka debug config file from task outputs (#3961)
  • Remove V2EnabledWithHelpers warning & info message (#4206)

Dokka's K2 analysis is enabled by default!

Dokka 2.1.0-Beta fixes the most problematic issues with K2 analysis and makes it enabled by default!
In addition to this, Dokka 2.1.0-Beta with K2 analysis introduces support for context parameters!

Dokka's K2 analysis leverages Kotlin's K2 compiler frontend for analysing code and uses the same shared Analysis API, which is used in IntelliJ IDEA’s K2 mode.
The output with K2 analysis should mostly match that of K1 analysis, but there may be minor differences.

If you previously opted in to Dokka's K2 analysis, remove org.jetbrains.dokka.experimental.tryK2 from your project's gradle.properties file.
Dokka's K1 analysis is still available, but it is deprecated and will be removed in future releases.
We would greatly appreciate your feedback, if there is something that is blocking you from migrating to K2 analysis!

Other fixes and improvements

  • Fix merging of implicit expect/actual with a single declaration (#4016)
  • Support Wasm platform fully (#4123)
  • Fix override modifier for generic functions (#4126)
  • Add a receiver to accessor DRI (#4122)
  • Fix param tag for type parameter on implicit primary constructor (#4154)
  • Fix the primary constructor parameter incorrectly marked as a property (#4125)
  • Fix Javadoc links with generic parameters (#4159)
  • Show the correct return type when narrowed by inheritance (#4183)

HTML format refinement

Dokka 2.1.0-Beta introduces a number of design improvements to the HTML output.
Many UI elements (listed below) now feature more consistent spacing, better contrast, and improved overall accessibility.

Highlights:

  • Improved accessibility of the Search popup and Table of Contents and Tabs
  • Resizable Table of Contents
  • Customizable spacing in the Table of Contents via a new set of CSS variables (See #4184 for details)

In addition, the structure of the templates has been slightly modified. If you're using custom templates, the easiest way to migrate is to update your templates based on the latest default templates.
For example, to enable the resizable Table of Contents, you need to add a <div id="resizer"> element and add [data-item-type] attributes to container elements. For implementation details, see the template reference.

Updated UI Elements:

  • Main layout
  • Table of Contents
  • Footer
  • Search popup
  • Code areas and code blocks
  • Links
  • Tooltips
  • Tables
  • Markdown tables

Notable improvements

  • Performance:
    • Cache packages field, which is used by DefaultExternalLocationProvider.resolve (#4009)
    • Cache DisplaySourceSet as it's stored a lot inside of ContentPages (#4008)
    • Significantly improves the performance when working with PackageList (#4198)
  • Support a newline inside link text (#3661)
  • Resolve references to quoted names (#3356)
  • Update jackson to 2.15.3, which doesn't have known vulnerabilities (#4189)
  • Make Dokka safe for jackson updates in user projects (#4193)

Other changes and bugfixes

  • Update java supertype processing (#3997). Thanks to @juliamcclellan!
  • Filter non-directory and hidden files from version directories (#3973). Thanks to @jeffdgr8!
  • Drop last additional newline character added when rewriting parsed HTML (#3974). Thanks to @jeffdgr8!
  • Fix constructor details to show description instead of brief in Javadoc (#4105). Thanks to @dmitrysulman!
  • Remove trove4j from dependencies (#3178)
  • Make Dokka compatible with JDK 25 (#4202)
  • Fix parsing of > in code blocks (#4210)

Feedback

We would appreciate your feedback!

See Dokka 2.1.0 milestone for the list of all changes.

Don't miss a new dokka release

NewReleases is sending notifications on new releases.