Skip to content

Commit e5cc404

Browse files
berezinantzoobestikfzhinkin
authored
feat: added dokka templates directory for kotlinlang (#377)
* feat: added dokka templates directory for kotlinlang * Use `projectDir.resolve` Co-authored-by: Filipp Zhinkin <filipp.zhinkin@jetbrains.com> * Move DokkaMultiModuleTask to kotlinx-io-dokka.gradle.kts * Use `projectDir.resolveSibling` Co-authored-by: Filipp Zhinkin <filipp.zhinkin@jetbrains.com> --------- Co-authored-by: Konstantin Chernenko <kb.chernenko@gmail.com> Co-authored-by: Filipp Zhinkin <filipp.zhinkin@jetbrains.com>
1 parent 1dae118 commit e5cc404

File tree

2 files changed

+33
-0
lines changed

2 files changed

+33
-0
lines changed

build-logic/src/main/kotlin/kotlinx/io/conventions/kotlinx-io-dokka.gradle.kts

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
* Use of this source code is governed by the Apache 2.0 license that can be found in the LICENCE file.
44
*/
55

6+
import org.jetbrains.dokka.gradle.DokkaMultiModuleTask
67
import org.jetbrains.dokka.gradle.DokkaTaskPartial
78
import java.net.URL
89

@@ -11,6 +12,14 @@ plugins {
1112
}
1213

1314
tasks.withType<DokkaTaskPartial>().configureEach {
15+
pluginsMapConfiguration.set(
16+
mapOf(
17+
"org.jetbrains.dokka.base.DokkaBase" to """{ "templatesDir" : "${
18+
projectDir.resolveSibling("dokka-templates")
19+
}"""
20+
)
21+
)
22+
1423
dokkaSourceSets.configureEach {
1524
includes.from("Module.md")
1625

@@ -34,3 +43,15 @@ tasks.withType<DokkaTaskPartial>().configureEach {
3443
)
3544
}
3645
}
46+
47+
tasks.withType(DokkaMultiModuleTask::class.java) {
48+
pluginsMapConfiguration.set(
49+
mapOf(
50+
"org.jetbrains.dokka.base.DokkaBase" to """{ "templatesDir" : "${
51+
projectDir.resolve(
52+
"dokka-templates"
53+
)
54+
}" }"""
55+
)
56+
)
57+
}

dokka-templates/README.md

Lines changed: 12 additions & 0 deletions
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.metadata 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://kotlinlang.org/docs/dokka-html.html#templates), you can
12+
find more about the customization of Dokka's HTML output.

0 commit comments

Comments
 (0)