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

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

Closed
EdricChan03 opened this issue Apr 21, 2022 · 0 comments · Fixed by #2456
Closed

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

EdricChan03 opened this issue Apr 21, 2022 · 0 comments · Fixed by #2456
Labels

Comments

@EdricChan03
Copy link
Contributor

EdricChan03 commented Apr 21, 2022

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

EdricChan03 added a commit to EdricChan03/dokka that referenced this issue Apr 21, 2022
IgnatBeresnev pushed a commit that referenced this issue Apr 25, 2022
* Fix missing external docs for some AndroidX libraries

Closes #2455
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant