kodeshare/src/main/kotlin/moe/kageru/kodeshare/pages/PastePage.kt

28 lines
752 B
Kotlin

package moe.kageru.kodeshare.pages
import io.ktor.html.HtmlContent
import io.ktor.http.HttpStatusCode
import kotlinx.html.*
object PastePage {
fun build(content: String) = HtmlContent(HttpStatusCode.OK) {
head {
link(rel = "stylesheet", href = "/style.css", type = "text/css")
link(
rel = "stylesheet",
href = "https://p.kageru.moe/static/hljs.css",
type = "text/css"
)
script(src = "https://p.kageru.moe/static/hl.js") {}
unsafe { +"<script>hljs.initHighlightingOnLoad();</script>" }
}
body {
pre {
code {
+content
}
}
}
}
}