package org.jetbrains.dokka public class KotlinWebsiteFormatService(locationService: LocationService, signatureGenerator: LanguageService) : JekyllFormatService(locationService, signatureGenerator) { override fun appendFrontMatter(nodes: Iterable, to: StringBuilder) { super.appendFrontMatter(nodes, to) to.appendln("layout: api") } override public fun formatBreadcrumbs(items: Iterable): String { items.drop(1) if (items.count() > 1) { return "
" + items.map { formatLink(it) }.joinToString(" / ") + "
" } return "" } override public fun formatCode(code: String): String = if (code.length() > 0) "$code" else "" override fun formatStrikethrough(text: String): String = "$text" override fun appendAsSignature(to: StringBuilder, block: () -> Unit) { val oldLength = to.length() block() if (to.length() > oldLength) { to.append("
") // since we've used HTML to format the signature, add an HTML line break following it } } override fun formatLink(text: String, href: String): String { return "${text}" } override fun appendTable(to: StringBuilder, body: () -> Unit) { to.appendln("") body() to.appendln("
") } override fun appendTableHeader(to: StringBuilder, body: () -> Unit) { to.appendln("") body() to.appendln("") } override fun appendTableBody(to: StringBuilder, body: () -> Unit) { to.appendln("") body() to.appendln("") } override fun appendTableRow(to: StringBuilder, body: () -> Unit) { to.appendln("") body() to.appendln("") } override fun appendTableCell(to: StringBuilder, body: () -> Unit) { to.appendln("") body() to.appendln("\n") } override public fun appendBlockCode(to: StringBuilder, line: String, language: String) { if (language.isNotEmpty()) { super.appendBlockCode(to, line, language) } else { to.append("
")
            to.append(line.trimLeading())
            to.append("
") } } override fun formatSymbol(text: String): String { return "${formatText(text)}" } override fun formatKeyword(text: String): String { return "${formatText(text)}" } override fun formatIdentifier(text: String, kind: IdentifierKind): String { return "${formatText(text)}" } private fun identifierClassName(kind: IdentifierKind) = when(kind) { IdentifierKind.ParameterName -> "parameterName" else -> "identifier" } }