Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Aggregating Dokka HTML in root project results in 404s when clicking on root project #3992

Open
adam-enko opened this issue Jan 13, 2025 · 1 comment
Labels
bug format: html An issue/PR related to Dokka's default HTML output format runner: gradle plugin v2 Issues fixed by Dokka Gradle Plugin v2 - see https://github.com/Kotlin/dokka/issues/3131 runner: Gradle plugin An issue/PR related to Dokka's Gradle plugin

Comments

@adam-enko
Copy link
Member

adam-enko commented Jan 13, 2025

Aggregating Dokka HTML in root project results in 404s when clicking on root project

Reproduce

Modify https://github.com/Kotlin/dokka/tree/v2.0.0/examples/gradle-v2/multimodule-example

  • Add a Kotlin class to the root project src/main/kotlin/RootClass.kt

  • Aggregate in the root project:

    plugins {
        kotlin("jvm")
        `dokka-convention`
    }
    dependencies {
        dokka(rootProject)
        dokka(project(":childProjectA"))
        dokka(project(":childProjectB"))
    }
  • Run ./gradlew :dokkaGen

Error

The HTML homepage looks correct (with URL http://localhost:63342/dokka/examples/gradle-v2/multimodule-example/build/dokka/html/index.html), and contains the root project (named multimodule-example)

image

However, clicking on multimodule-example results in a 404.

Note that the 404ing URL has a double slash // and /html/ is missing.

http://localhost:63342/dokka/examples/gradle-v2/multimodule-example/build/dokka//index.html

Expected:
http://localhost:63342/dokka/examples/gradle-v2/multimodule-example/build/dokka/html/[root]/index.html
Actual:
http://localhost:63342/dokka/examples/gradle-v2/multimodule-example/build/dokka//index.html

Workaround

To workaround specify modulePath in the root project:

dokka {
   modulePath = "root"
}

Additional context

@adam-enko adam-enko added bug format: html An issue/PR related to Dokka's default HTML output format runner: Gradle plugin An issue/PR related to Dokka's Gradle plugin labels Jan 13, 2025
@whyoleg
Copy link
Collaborator

whyoleg commented Jan 14, 2025

probably it's the same as #3979

@whyoleg whyoleg added the runner: gradle plugin v2 Issues fixed by Dokka Gradle Plugin v2 - see https://github.com/Kotlin/dokka/issues/3131 label Jan 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug format: html An issue/PR related to Dokka's default HTML output format runner: gradle plugin v2 Issues fixed by Dokka Gradle Plugin v2 - see https://github.com/Kotlin/dokka/issues/3131 runner: Gradle plugin An issue/PR related to Dokka's Gradle plugin
Projects
None yet
Development

No branches or pull requests

2 participants