From 47061b109dc00b7e2ca90fccde5dc825afc2500c Mon Sep 17 00:00:00 2001 From: nikpachoo Date: Tue, 9 Aug 2022 10:06:14 +0200 Subject: [PATCH] ktl-695 chore: support Dokka HTML customization --- build.gradle | 4 ++++ dokka-templates/README.md | 12 ++++++++++++ gradle/dokka.gradle | 2 ++ 3 files changed, 18 insertions(+) create mode 100644 dokka-templates/README.md diff --git a/build.gradle b/build.gradle index 236943b8b..0d21932ae 100644 --- a/build.gradle +++ b/build.gradle @@ -188,3 +188,7 @@ subprojects { apply from: rootProject.file('gradle/compiler-version.gradle') apply from: rootProject.file("gradle/dokka.gradle") apply from: rootProject.file("gradle/benchmark-parsing.gradle") + +tasks.named("dokkaHtmlMultiModule") { + pluginsMapConfiguration.set(["org.jetbrains.dokka.base.DokkaBase": """{ "templatesDir": "${projectDir.toString().replace('\\', '/')}/dokka-templates" }"""]) +} diff --git a/dokka-templates/README.md b/dokka-templates/README.md new file mode 100644 index 000000000..2b16f5bfc --- /dev/null +++ b/dokka-templates/README.md @@ -0,0 +1,12 @@ +# Dokka's template customization +To provide unified navigation for all parts of [kotlinlang.org](https://kotlinlang.org/), +the Kotlin Website Team uses this directory to place custom templates in this folder +during the website build time on TeamCity. + +It is not practical to place these templates in the kotlinx.serialization repository because they change from time to time +and aren't related to the library's release cycle. + +The folder is defined as a source for custom templates by the templatesDir property through Dokka's plugin configuration. + +[Here](https://kotlin.github.io/dokka/1.7.20-SNAPSHOT/user_guide/output-formats/html/#custom-html-pages), you can +find more about the customization of Dokka's HTML output. \ No newline at end of file diff --git a/gradle/dokka.gradle b/gradle/dokka.gradle index 157ab82e5..bccf4fd71 100644 --- a/gradle/dokka.gradle +++ b/gradle/dokka.gradle @@ -20,6 +20,8 @@ subprojects { tasks.named('dokkaHtmlPartial') { outputDirectory = file("build/dokka") + pluginsMapConfiguration.set(["org.jetbrains.dokka.base.DokkaBase": """{ "templatesDir": "${rootProject.projectDir.toString().replace('\\', '/')}/dokka-templates" }"""]) + dokkaSourceSets { configureEach { includes.from(rootProject.file('dokka/moduledoc.md').path)