Open msink opened 6 years ago
Right now it is not supported
This will do it:
task dokkaKdoc(type: org.jetbrains.dokka.gradle.DokkaTask) {
outputFormat = 'gfm'
outputDirectory = "$buildDir/kdoc"
}
import java.nio.file.Files
import java.nio.file.Paths
import java.nio.file.StandardCopyOption
task createReadmeFiles(dependsOn: dokkaKdoc) {
doFirst {
Files.walk(Paths.get(dokkaKdoc.outputDirectory))
.filter { it.getFileName().toString().toLowerCase() == "index.md" }
.forEach {
try {
Files.copy(it, it.resolveSibling("README.md"), StandardCopyOption.REPLACE_EXISTING)
} catch (e) {
throw new RuntimeException(e)
}
}
}
}
Just call createReadmeFiles instead of dokkaKdoc
@semoro/ @msink will this feature be supported in a future release?
You can register this task that renames index.md
to README.md
after dokkaGfm finishes
build.gradle.kts
dokkaGfm {
outputDirectory.set(file("$rootDir/docs/"))
}
tasks.register('renameDokkaReadme') {
doLast {
file("$rootDir/docs/index.md").renameTo("$rootDir/docs/README.md")
}
}
tasks.dokkaGfm.finalizedBy renameDokkaReadme
Is it possible to generate
README.md
instead ofindex.md
for each class, in github flavored markdown mode?