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

35 lines
1000 B
Kotlin
Raw Normal View History

2019-09-29 08:17:31 +02:00
package moe.kageru.kodeshare.pages
import io.ktor.html.HtmlContent
import kotlinx.html.*
object PastePage {
2019-09-29 17:10:02 +02:00
fun build(content: String, type: String?) = HtmlContent {
2019-09-29 08:17:31 +02:00
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") {}
2019-10-31 13:01:18 +01:00
unsafe {
+"<script>hljs.initHighlightingOnLoad();</script>"
2019-10-31 13:04:55 +01:00
+"<style>html{scrollbar-color: transparent transparent;}::-webkit-scrollbar{display: none;}</style>"
2019-10-31 13:01:18 +01:00
}
2019-09-29 08:17:31 +02:00
}
body {
pre {
2019-09-29 09:51:15 +02:00
code(classes = type) {
2019-09-29 08:17:31 +02:00
+content
}
}
2019-09-29 11:50:14 +02:00
a("/") {
div(Css.FLOATY_CLASS) {
2019-09-29 10:15:42 +02:00
+"New paste"
}
}
2019-09-29 08:17:31 +02:00
}
}
}