Skip to content

Commit 6490707

Browse files
authored
Support Dokka HTML customization (Kotlin#2008)
1 parent 738d131 commit 6490707

File tree

3 files changed

+18
-0
lines changed

3 files changed

+18
-0
lines changed

build.gradle

+4
Original file line numberDiff line numberDiff line change
@@ -188,3 +188,7 @@ subprojects {
188188
apply from: rootProject.file('gradle/compiler-version.gradle')
189189
apply from: rootProject.file("gradle/dokka.gradle")
190190
apply from: rootProject.file("gradle/benchmark-parsing.gradle")
191+
192+
tasks.named("dokkaHtmlMultiModule") {
193+
pluginsMapConfiguration.set(["org.jetbrains.dokka.base.DokkaBase": """{ "templatesDir": "${projectDir.toString().replace('\\', '/')}/dokka-templates" }"""])
194+
}

dokka-templates/README.md

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Dokka's template customization
2+
To provide unified navigation for all parts of [kotlinlang.org](https://kotlinlang.org/),
3+
the Kotlin Website Team uses this directory to place custom templates in this folder
4+
during the website build time on TeamCity.
5+
6+
It is not practical to place these templates in the kotlinx.serialization repository because they change from time to time
7+
and aren't related to the library's release cycle.
8+
9+
The folder is defined as a source for custom templates by the templatesDir property through Dokka's plugin configuration.
10+
11+
[Here](https://kotlin.github.io/dokka/1.7.20-SNAPSHOT/user_guide/output-formats/html/#custom-html-pages), you can
12+
find more about the customization of Dokka's HTML output.

gradle/dokka.gradle

+2
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ subprojects {
2020

2121
tasks.named('dokkaHtmlPartial') {
2222
outputDirectory = file("build/dokka")
23+
pluginsMapConfiguration.set(["org.jetbrains.dokka.base.DokkaBase": """{ "templatesDir": "${rootProject.projectDir.toString().replace('\\', '/')}/dokka-templates" }"""])
24+
2325
dokkaSourceSets {
2426
configureEach {
2527
includes.from(rootProject.file('dokka/moduledoc.md').path)

0 commit comments

Comments
 (0)