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
Annotation class does not have a (source)
link in HTML
#2958
Comments
(source)
link(source)
link in HTML
This looks to be a configuration bug of some sort. I now really wish #2873 was implemented... Building the docs for the following code annotation class MyAnnotation {} With the following configuration tasks.withType<DokkaTask>().configureEach {
dokkaSourceSets.configureEach {
sourceLink {
localDirectory.set(file("src/main/kotlin"))
remoteUrl.set(
URL(
"https://github.com/IgnatBeresnev/dokka-debug-kts/tree/master/src/main/kotlin"
)
)
remoteLineSuffix.set("#L")
}
}
} I'm unable to reproduce it: And there's a test for source links that has an annotation class as input:
|
Ahh okay, that is quite possible. Thanks for checking. I actually skipped out some details that I realise now might be relevant. I made a special source set only for the custom opt-in annotation, because it was marked as dokkatoo {
dokkatooSourceSets.register("DokkatooInternalApi") {
// create a special source set just for documenting the internally visible DokkatooInternalApi
documentedVisibilities(INTERNAL)
sourceRoots.from(layout.projectDirectory.dir("src/main/kotlin").asFileTree.matching {
include("**/DokkatooInternalApi.kt")
})
}
dokkatooSourceSets.configureEach {
sourceLink {
localDirectory.set(file("src/main/kotlin"))
val relativeProjectPath = projectDir.relativeToOrNull(rootDir)?.invariantSeparatorsPath ?: ""
remoteUrl("https://github.com/adamko-dev/dokkatoo/tree/main/$relativeProjectPath/src/main/kotlin")
}
}
} So maybe there's some issue with the source links when there are multiple source links...? Anyway, as I was writing this up I realised that making the annotation
The DokkaParametersKxs JSON above should be close enough :) |
quite possibly, yes dokka/plugins/base/src/main/kotlin/transformers/pages/sourcelinks/SourceLinksTransformer.kt Line 115 in d1b2498
Yeah, but I don't know how the current plugin configured it so that we can compare old and new, and I don't want to go into debugging if I don't have to 😅 |
Placing it in a different package and configuring the visibility with |
Describe the bug
I've configured a source link for my project (using Gradle + Dokkatoo)
The source link is correctly generated for all classes/functions/etc, except not for annotation classes.
Expected behaviour
Screenshots
For a regular class the
(source)
link is visible on the righthand-side:However, it there is no
(source
) link for an annotation class:To Reproduce
62f19ecbba2291ef05d7c924941a75112008c2ff
https://github.com/adamko-dev/dokkatoo/tree/62f19ecbba2291ef05d7c924941a75112008c2ff./gradlew dokkatooGenerate
./docs/build/dokka/html/index.html
.../dokkatoo/docs/build/dokka/html/modules/dokkatoo-plugin/dev.adamko.dokkatoo.internal/-dokkatoo-internal-api/index.html
Dokka configuration
Module configuration
Publication configuration
Installation
Additional context
Possibly related to #2642?
The text was updated successfully, but these errors were encountered: