Skip to content

Commit

Permalink
Update build.gradle.kts
Browse files Browse the repository at this point in the history
  • Loading branch information
z4kn4fein committed Apr 5, 2024
1 parent 9ec8dd4 commit 5becd14
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -129,13 +129,16 @@ tasks.getByName<DokkaTask>("dokkaHtml") {
outputDirectory.getAsFileTree().getFiles()
.filter { it.extension == "html" }
.forEach { file ->
val text = file.readText()
file.writeText(
text.replace(
var text = file.readText()
if (!(file.parent?.endsWith("dokka") ?: false)) {
text = text.replace(
"<script type=\"text/javascript\" src=\"https://unpkg.com/kotlin-playground@1/dist/playground.min.js\" async=\"async\"></script>",
"<script type=\"text/javascript\" src=\"https://unpkg.com/kotlin-playground@1\" data-selector=\"code\" " +
"data-server=\"https://pcsajtai-kotlin-compiler.onrender.com\"></script>"
).replace(
"data-server=\"https://pcsajtai-kotlin-compiler.onrender.com\"></script>"
)
}
file.writeText(
text.replace(
"<button class=\"navigation-controls--btn navigation-controls--theme\" id=\"theme-toggle-button\" type=\"button\">switch theme</button>",
"<a href=\"https://github.com/z4kn4fein/kotlin-semver\" target=\"_blank\" rel=\"noopener\" class=\"gh-link\"><i class=\"fa fa-github\"></i> <span class=\"repo-name\">" +
"z4kn4fein/kotlin-semver</span></a><button class=\"navigation-controls--btn navigation-controls--theme\" id=\"theme-toggle-button\" type=\"button\">switch theme</button>"
Expand Down

0 comments on commit 5becd14

Please sign in to comment.