2019-09-29 11:50:14 +02:00
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 {
2019-10-25 22:48:19 +02:00
private val domain = " ${config[ServerSpec.domain]} "
2019-09-29 11:50:14 +02:00
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 " ) {
2019-09-29 17:03:44 +02:00
+ " $domain /rx78.kt "
2019-09-29 11:50:14 +02:00
}
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 {
2019-09-29 13:26:05 +02:00
+ " All pastes are limited to 1 MiB, and empty pastes are rejected. "
2019-09-29 11:50:14 +02:00
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. "
}
}
}
}
2019-09-29 17:18:38 +02:00
}