package moe.kageru.kodeshare.pages import io.ktor.html.HtmlContent import io.ktor.http.HttpStatusCode import kotlinx.html.* import moe.kageru.kodeshare.config.ServerSpec import moe.kageru.kodeshare.config.config object AboutPage { private val domain = "${config[ServerSpec.domain]}" val content = HtmlContent(HttpStatusCode.OK) { head { link(rel = "stylesheet", href = "/style.css", type = "text/css") } body { div("wrapper") { h2 { +"kodeshare - yet another paste service" } a("/") { div(Css.FLOATY_CLASS) { +"Back" } } p { +"Hi. I’m kageru, and I didn’t want to rely on hastebin and the likes anymore." br +"I had a few hours to spare on a train trip, so I decided to try " a("https://ktor.io") { +"ktor" } +" for web programming in Kotlin." br +"If you’re interested, the source code can be found " a("https://git.kageru.moe/kageru/kodeshare") { +"on my Gitea." } } h3 { +"Usage" } p { +"Everything you see here can also be used via CLI." div("framed") { +"$ curl -F'file=@someFile' $domain/" br +"# returns" br +"$domain/rx78" } +"If you need to download or view a file as plain text, simply add /r/ after the domain name. " br +"Using our earlier example, the raw link would be:" div("framed") { +"$domain/r/rx78" } +" The HTML view uses " a("https://highlightjs.org/") { +"highlight.js" } +" for syntax highlighting. " +"If the automatic detection fails, you can override it by appending the file extension to the url." br div("framed") { +"$domain/rx78.kt" } br br +"If you choose to disable Javascript entirely, everything other than the syntax highlighting will still work as intended. " +"Pastes will simply be monochrome." } h3 { +"Expiration & limits" } p { +"All pastes are limited to 1 MiB, and empty pastes are rejected." br +"Right now, pastes are not pruned or deleted at all. " +"If more people start using this, I might add something that deletes unaccessed pastes after a few months. We’ll see." } } } } }