Skip to content

Generated docs don't include API links to Jetpack Compose libraries by default #2455

@EdricChan03

Description

@EdricChan03

Describe the bug
The generated Dokka documentation does not include API links to Android Jetpack's Compose libraries by default.

Expected behaviour
The generated Dokka documentation should include Android Jetpack's Compose libraries by default. (i.e. link to the respective Jetpack Compose classes where possible)

Screenshots
image

The Modifier class should link to the Modifier class in the Android docs, but in this screenshot it doesn't.

To Reproduce

  1. Clone EdricChan03/Ephemeris and checkout the feat/dokka branch
  2. Run ./gradlew dokkaHtmlMultiModule to generate the Dokka docs
  3. Navigate to and open the generated docs (build/dokka/htmlMultiModule) (for e.g. with npx http-server)
  4. In the docs, expand the "android-compose" module > compose package > EphemerisCalendarView

Dokka configuration
Configuration of dokka used to reproduce the bug

tasks.withType<DokkaTaskPartial>().configureEach {
    moduleName.set(publishing.publications["release"].cast<MavenPublication>().artifactId)

    dokkaSourceSets {
        named("main") {
            sourceLink {
                localDirectory.set(file("src/main/kotlin"))

                remoteUrl.set(URL(
                    "https://github.com/boswelja/Ephemeris/blob/main/android/compose/src/main/kotlin"))
            }
        }
    }
}

Installation

  • Operating system: Windows
  • Build tool: Gradle v7.4.2
  • Dokka version: 1.6.20

Additional context
N/A

Are you willing to provide a PR?
I suppose so. Looking around in the source code for "AndroidX" points me to defaultExternalLinks.kt, which is used for the default externalDocumentationLinks.

I believe the line to fix should be as follows:

packageListUrl = URL("https://developer.android.com/reference/androidx/package-list")

It should be modified from https://developer.android.com/reference/androidx/package-list to https://developer.android.com/reference/kotlin/androidx/package-list, which should then include the Kotlin-only libraries like Jetpack Compose

Edit: I've just opened a PR #2456

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions