package-tree.html and package-overview.html missing in javadoc after upgrading to 1.4.20
Describe the bug After upgrading to 1.4.20 package-tree.html and package-overview.html are missing in the root, generating 404s
To Reproduce In https://github.com/node-gradle/gradle-node-plugin/commit/c36586ecac0ef774eb297dfe2120a23c7360f1da we upgraded, before it was working (and had frames), afterwards it's generating 404s (and lacks frames).
Dokka configuration Configuration of dokka used to reproduce the bug
tasks.dokkaJavadoc {
dokkaSourceSets {
named("main") {
jdkVersion.set(8)
sourceLink {
localDirectory.set(file("src/main/kotlin"))
remoteUrl.set(uri(
"https://github.com/node-gradle/gradle-node-plugin/blob/master/src/main/kotlin"
).toURL()
)
remoteLineSuffix.set("#L")
}
externalDocumentationLink {
url.set(uri("https://node-gradle.github.io/gradle-node-plugin/").toURL())
}
}
}
}
I can confirm this. I just checked that it happens also on the official example project here https://github.com/Kotlin/kotlin-examples/tree/master/gradle/dokka/dokka-gradle-example It is a quite serious issue. I think.
overview-tree.html is missing as well. Or if we couldn't generate it, can't we just disable the "Tree" button from the parent page? Using the sample project 'dokka-kotlinAsJava-example', run
./gradlew dokkaJavadoc
We are aware of this issue, some resources are missing since they are not yet implemented. Order dokka used a dockelet API to generate javadoc but we had to move away from it.
We will eventually make our implementation complete but this takes a little bit of time :) It you would like to help, i highly encourage you to contribute βΊοΈ
Thanks! I understand. But then, why not keep the old fully working solution until a new one is finished?
Keeping the old solution unfortunately wasn't an option since whole dokka architecture has changed since then (whole dokka was rewritten :D)
Is there a way to disable the "Tree" and "package" links in the meantime? I am using Maven
@leon-li1 We're facing the same issue
So far we will probably go with post-documentation-generation scripts (more like a few bash commands actually) that will patch newly generated doc.
In particular, running find . -type f -name "*.html" -exec sed -i '' '/<li><a href="overview-tree\.html">Tree<\/a><\/li>/d' {} \; ; find . -type f -name "*.html" -exec sed -i '' '/<li><a href="package-tree\.html">Tree<\/a><\/li>/d' {} \; in terminal in dokka output dir root will remove broken "TREE" links.
In addition to that we also remove search widget because of it's poor performance:
find . -type f -name "*.html" -exec perl -0777 -i -pe 's/<ul class="navListSearch">[\s\S]+?<\/ul>//s' {} \;
... and remove "empty" like-a-hyperlink looking captions in header and footer of every page (e.g. on index.html page those are PACKAGE and CLASS) and also HELP caption - leaving them only there where they are actually are links and transfer you to some other page:
find . -type f -name "*.html" -exec sed -i '' '/<li>Help<\/li>/d' {} \;
find . -type f -name "*.html" -exec sed -i '' '/<li>Class<\/li>/d' {} \;
find . -type f -name "*.html" -exec sed -i '' '/<li>Package<\/li>/d' {} \;
sed -i '' '/<li><a href="package-summary.html">Package<\/a><\/li>/d' deprecated.html
sed -i '' '/<li><a href="package-summary.html">Package<\/a><\/li>/d' ./index-files/index-1.html
Eventually, I've concatenated those commands into one and plan to include it into our release scripts flow right after generating documentation:
find . -type f -name "*.html" -exec sed -i '' '/<li><a href="overview-tree\.html">Tree<\/a><\/li>/d' {} \; ;find . -type f -name "*.html" -exec sed -i '' '/<li><a href="package-tree\.html">Tree<\/a><\/li>/d' {} \; ;find . -type f -name "*.html" -exec sed -i '' '/<li>Help<\/li>/d' {} \; ;find . -type f -name "*.html" -exec sed -i '' '/<li>Class<\/li>/d' {} \; ;find . -type f -name "*.html" -exec sed -i '' '/<li>Package<\/li>/d' {} \; ;sed -i '' '/<li><a href="package-summary.html">Package<\/a><\/li>/d' deprecated.html ;sed -i '' '/<li><a href="package-summary.html">Package<\/a><\/li>/d' ./index-files/index-1.html ;find . -type f -name "*.html" -exec perl -0777 -i -pe 's/<ul class="navListSearch">[\s\S]+?<\/ul>//s' {} \;
I'm 99.99% sure that those could be optimized, but for now they work and on our quite-big SDK documentation running this takes several seconds locally on macbook pro.
P. S.: so that nobody has any doubts: this does smell like crutch and is a dirty workaround. But we are developing and maintaining SDK for money, and it is written in Kotlin so not much else to do for us. Dokka maintainers have done enormous a great job between 0.10.x and 1.4.x versions but we as users are still hoping to see some improvement and polishing in future.
Hi all π. Could someone check to see if package-tree.html and package-overview.html are still missing issue when using Dokka 2.1.0?
Also, unless there's a reason you Dokka to generate Javadoc documentation I recommend using Dokka's own HTML format, which works nicer and shows real Kotlin declarations, like here: https://kotlinlang.org/api/kotlinx.coroutines/kotlinx-coroutines-core/. Furthermore, sites like javadoc.io can render Dokka's HTML example
Hi all π. Could someone check to see if
package-tree.htmlandpackage-overview.htmlare still missing issue when using Dokka 2.1.0?Also, unless there's a reason you Dokka to generate Javadoc documentation I recommend using Dokka's own HTML format, which works nicer and shows real Kotlin declarations, like here: https://kotlinlang.org/api/kotlinx.coroutines/kotlinx-coroutines-core/. Furthermore, sites like javadoc.io can render Dokka's HTML example
yes, those two files are still missing from dokka 2.1.0.