Open CLOVIS-AI opened 2 years ago
In the meantime, it could be achieved by configuring Dokka's tasks:
import org.jetbrains.dokka.gradle.DokkaTask
plugins {
id("org.jetbrains.dokka")
}
tasks.withType<DokkaTask>().configureEach {
doLast {
println("Documentation generated to ${outputDirectory.get()}")
}
}
Output:
$ ./gradlew clean dokkaHtml
> Task :dokkaHtml
Initializing plugins
Dokka is performing: documentation for dokka-debug-kts
Validity check
Creating documentation models
Transforming documentation model before merging
Merging documentation models
Transforming documentation model after merging
Creating pages
Transforming pages
Rendering
Running post-actions
Documentation generated to /home/{user}/IdeaProjects/{project}/build/dokka/html
Is your feature request related to a problem? Please describe When I run
./gradlew dokkaHtmlMultiModule
, I often want to open the files in a browser. Currently, I have to run<browser> build/dokka/htmlMultiModule/index.html
, which is inconvenient and unfriendly for newcomers to the project.Describe the solution you'd like When Dokka is done building the project, it prints a
file://
path to the generatedindex.html
file. Smart displays (the IDEA's console, emulators like KDE's Konsole) automatically replace it by an hyperlink that the user can click to open the file in their browser.Describe alternatives you've considered I guess it could be possible to open the file in the browser directly or introduce a task
dokkaOpenBrowser
but that seems like more trouble than it's worth, especially when paths infile://
seem well supported.Additional context This seems to be a common solution to this problem.
For example, the integrated
test
task in Gradle:As another example, JetBrains' Kover:
Are you willing to provide a PR? I'm not familiar with Gradle plugins nor with Dokka's codebase, but this seems like a trivial feature (it's just printing out the path that Dokka writes to). With an outline of where to look and what to change, I can provide a PR.