Package io.ktor.html

Types

Link copied to clipboard
class HtmlContent(status: HttpStatusCode?, builder: HTML.() -> Unit) : OutgoingContent.WriteChannelContent

Represents an OutgoingContent using kotlinx.html builder.

Link copied to clipboard
open class Placeholder<TOuter>

A placeholder that is inserted inside TOuter

Link copied to clipboard
class PlaceholderItem<TOuter>(index: Int, collection: List<PlaceholderItem<TOuter>>) : Placeholder<TOuter>

Item of a placeholder list when it is expanded

Link copied to clipboard
open class PlaceholderList<TOuter, TInner>

Placeholder that can appear multiple times

Link copied to clipboard
interface Template<in TOuter>

A template that expands inside TOuter

Link copied to clipboard
open class TemplatePlaceholder<TTemplate>

A placeholder that is also a template

Functions

Link copied to clipboard
fun <TOuter, TInner> TOuter.each(items: PlaceholderList<TOuter, TInner>, itemTemplate: TOuter.(PlaceholderItem<TInner>) -> Unit)

Inserts every element of placeholder list

Link copied to clipboard
fun <TOuter> TOuter.insert(placeholder: Placeholder<TOuter>)

Inserts placeholder

fun <TTemplate : Template<TOuter>, TOuter> TOuter.insert(template: TTemplate, placeholder: TemplatePlaceholder<TTemplate>)
fun <TOuter, TTemplate : Template<TOuter>> TOuter.insert(template: TTemplate, build: TTemplate.() -> Unit)
Link copied to clipboard
suspend fun ApplicationCall.respondHtml(status: HttpStatusCode = HttpStatusCode.OK, block: HTML.() -> Unit)

Responds to a client with a HTML response, using specified block to build an HTML page

Link copied to clipboard
suspend fun <TTemplate : Template<HTML>> ApplicationCall.respondHtmlTemplate(template: TTemplate, status: HttpStatusCode = HttpStatusCode.OK, body: TTemplate.() -> Unit)