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

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

Open
deepy opened this issue Jan 9, 2021 · 7 comments
Labels
bug format: Javadoc An issue/PR related to Dokka's Javadoc output format or the Javadoc comments in general

Comments

@deepy
Copy link

deepy commented Jan 9, 2021

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 node-gradle/gradle-node-plugin@c36586e 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 deepy added the bug label Jan 9, 2021
@MarcinAman MarcinAman added the format: Javadoc An issue/PR related to Dokka's Javadoc output format or the Javadoc comments in general label Jan 13, 2021
@tprochazka
Copy link

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.

@jsong
Copy link

jsong commented Jan 19, 2021

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

@MarcinAman
Copy link
Contributor

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

@tprochazka
Copy link

tprochazka commented Feb 1, 2021

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

@MarcinAman
Copy link
Contributor

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

@leon-li1
Copy link

leon-li1 commented Jun 9, 2021

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

@Den-Rimus
Copy link

Den-Rimus commented Jul 6, 2021

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug format: Javadoc An issue/PR related to Dokka's Javadoc output format or the Javadoc comments in general
Projects
None yet
Development

No branches or pull requests

8 participants