aboutsummaryrefslogtreecommitdiff
path: root/dokka-runners/dokkatoo/modules/docs/build.gradle.kts
diff options
context:
space:
mode:
authorAdam <897017+aSemy@users.noreply.github.com>2023-10-20 00:39:12 +1300
committerGitHub <noreply@github.com>2023-10-19 13:39:12 +0200
commit35d15601f2d129a7d3db67dd9e2f4c41c87ef083 (patch)
treef9098cb5b79fc31b4a393347f5cebcf9d87dd139 /dokka-runners/dokkatoo/modules/docs/build.gradle.kts
parent8016c1face1283952e228aee348487bf0421ab90 (diff)
downloaddokka-35d15601f2d129a7d3db67dd9e2f4c41c87ef083.tar.gz
dokka-35d15601f2d129a7d3db67dd9e2f4c41c87ef083.tar.bz2
dokka-35d15601f2d129a7d3db67dd9e2f4c41c87ef083.zip
Contribute Dokkatoo (#3188)
Diffstat (limited to 'dokka-runners/dokkatoo/modules/docs/build.gradle.kts')
-rw-r--r--dokka-runners/dokkatoo/modules/docs/build.gradle.kts58
1 files changed, 58 insertions, 0 deletions
diff --git a/dokka-runners/dokkatoo/modules/docs/build.gradle.kts b/dokka-runners/dokkatoo/modules/docs/build.gradle.kts
new file mode 100644
index 00000000..a27b177c
--- /dev/null
+++ b/dokka-runners/dokkatoo/modules/docs/build.gradle.kts
@@ -0,0 +1,58 @@
+import dev.adamko.dokkatoo.dokka.plugins.DokkaHtmlPluginParameters
+
+plugins {
+ buildsrc.conventions.base
+ dev.adamko.`dokkatoo-html`
+}
+
+dependencies {
+ dokkatoo(projects.modules.dokkatooPlugin)
+ dokkatooPluginHtml(libs.kotlin.dokkaPlugin.allModulesPage)
+ dokkatooPluginHtml(libs.kotlin.dokkaPlugin.templating)
+}
+
+dokkatoo {
+ moduleName.set("Dokkatoo Gradle Plugin")
+
+ pluginsConfiguration.named<DokkaHtmlPluginParameters>("html") {
+ customStyleSheets.from(
+ "./style/logo-styles.css",
+ )
+ customAssets.from(
+ "./images/logo-icon.svg",
+ )
+ }
+}
+
+tasks.dokkatooGeneratePublicationHtml {
+ doLast {
+ outputDirectory.get().asFile.walk()
+ .filter { it.isFile && it.extension == "html" }
+ .forEach { file ->
+ file.writeText(
+ file.readText()
+ .replace(
+ """<html>""",
+ """<html lang="en">""",
+ )
+ .replace(
+ """
+ <button id="theme-toggle-button">
+ """.trimIndent(),
+ """
+ <div id="github-link"><a href="https://github.com/adamko-dev/dokkatoo/"></a></div>
+ <button id="theme-toggle-button">
+ """.trimIndent(),
+ )
+ .replace(
+ """
+ href="https://github.com/Kotlin/dokka"><span>dokka</span>
+ """.trimIndent(),
+ """
+ href="https://github.com/adamko-dev/dokkatoo/"><span>Dokkatoo</span>
+ """.trimIndent(),
+ )
+ )
+ }
+ }
+}