Skip to content

Commit

Permalink
Rename kotlin to sources-for-web
Browse files Browse the repository at this point in the history
This makes it harder to edit generated files by accident.
I also changed the extension from kt to kt.txt so the files are not syntax-highlighted in the IDE.
  • Loading branch information
hamoid committed Dec 14, 2024
1 parent 023a8e2 commit 357c9e5
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.gradle
build
.idea
src/commonMain/resources/kotlin/
src/commonMain/resources/sources-for-web/
3 changes: 2 additions & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,8 @@ val embedSourcesTask by tasks.creating(Task::class) {
doLast {
copy {
from("src/commonMain/kotlin")
into("src/commonMain/resources/kotlin/")
rename { "$it.txt" }
into("src/commonMain/resources/sources-for-web/")
}
println("Copied kotlin folder into resources")
}
Expand Down
2 changes: 1 addition & 1 deletion src/commonMain/kotlin/TemplateProgram.kt
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@ fun main() {
"""<span>$programName</span> """
}

loadAndHighlight("kotlin/${currentProgram}.kt")
loadAndHighlight("sources-for-web/${currentProgram}.kt.txt")
}
external fun loadAndHighlight(url: String)
3 changes: 2 additions & 1 deletion src/commonMain/kotlin/fabulousPink.kt
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,5 @@ fun fabulousPink() = application {
// Construct and draw a closed Hobby curve with the points.
drawer.contour(hobbyCurve(points, true))
}
}}
}
}

0 comments on commit 357c9e5

Please sign in to comment.