Kotlin / dokka

API documentation engine for Kotlin
https://kotl.in/dokka
Apache License 2.0
3.34k stars 396 forks source link

The Dokka versioning dropdown is not visible #3597

Open DhanshriP opened 2 months ago

DhanshriP commented 2 months ago

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

vmishenev commented 1 month ago

It seems this issues is a duplicate of https://github.com/Kotlin/dokka/issues/3488#issuecomment-1928090498

DhanshriP commented 1 month ago

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