dokka icon indicating copy to clipboard operation
dokka copied to clipboard

package-tree.html and package-overview.html missing in javadoc after upgrading to 1.4.20

Open deepy opened this issue 4 years ago β€’ 9 comments

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())
            }
        }
    }
}

deepy avatar Jan 09 '21 15:01 deepy

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.

tprochazka avatar Jan 17 '21 23:01 tprochazka

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

jsong avatar Jan 19 '21 22:01 jsong

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 ☺️

MarcinAman avatar Feb 01 '21 13:02 MarcinAman

Thanks! I understand. But then, why not keep the old fully working solution until a new one is finished?

tprochazka avatar Feb 01 '21 22:02 tprochazka

Keeping the old solution unfortunately wasn't an option since whole dokka architecture has changed since then (whole dokka was rewritten :D)

MarcinAman avatar Feb 02 '21 07:02 MarcinAman

Is there a way to disable the "Tree" and "package" links in the meantime? I am using Maven

leon-li1 avatar Jun 09 '21 13:06 leon-li1

@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.

Den-Rimus avatar Jul 06 '21 15:07 Den-Rimus

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

adam-enko avatar Oct 22 '25 08:10 adam-enko

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

yes, those two files are still missing from dokka 2.1.0.

syphyr avatar Oct 23 '25 19:10 syphyr