Kotlin / dokka

API documentation engine for Kotlin

Home Page:https://kotl.in/dokka

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

The Dokka versioning dropdown is not visible

DhanshriP opened this issue · comments

Describe the bug

When setting up Dokka for an Android project with multiple modules sometimes face an issue. While creating versioning of documentation using dokka, dokkaPlugin should be added in build.gradle file
dependencies { dokkaPlugin('org.jetbrains.dokka:versioning-plugin:1.9.20') } and setting up the classpath for dokka-gradle-plugin on project level build.gradle and apply org.jetbrains.dokka plugin.

These steps are crucial for Dokka to create accurate and versioned documentation for multi module project.

Expected behaviour
As mentioned in example of dokka multi module, If anyone add versioning-plugin in classpath at project level build.gradle and dokkaPlugin dependency in module level build.gradle it should show dokka drop down of versions like shown in below screenshot :
Screenshots
Screenshot 2024-05-02 at 10 38 23 PM

To Reproduce
Followed steps and took a reference of official dokka repository:
https://github.com/Kotlin/dokka/tree/master/examples/gradle/dokka-versioning-multimodule-example

Dokka configuration

plugins {
    kotlin("jvm") version "1.9.22"
    id("org.jetbrains.dokka") version "1.9.20" apply false
}

// The versioning plugin must be applied in all submodules
subprojects {
    repositories {
        mavenCentral()
    }
    apply {
        plugin("org.jetbrains.kotlin.jvm")
        plugin("org.jetbrains.dokka")
    }
    val dokkaPlugin by configurations
    dependencies {
        dokkaPlugin("org.jetbrains.dokka:versioning-plugin:1.9.20")
    }
}

Installation

  • Operating system: macOS
  • Build tool: Gradle v8.0.2
  • Dokka version: 1.9.20

It seems this issues is a duplicate of #3488 (comment)

It seems this issues is a duplicate of #3488 (comment)

Yes, We need to apply plugin with dokkaHtmlMultiModule dependency otherwise it will not show versioning drop-down for multi module project.

As I have observed, official dokka documentation is not updated with same information.
Here I have created a blog for how to use versioning plugin in dokka for reference purpose:

https://medium.com/@dhanshri_pathrikar/streamlined-dokka-integration-multi-module-projects-with-versioning-plugin-in-android-abf7a70b2f69