package org.jetbrains.dokka public class KotlinWebsiteFormatService(locationService: LocationService, signatureGenerator: LanguageService) : JekyllFormatService(locationService, signatureGenerator) { override val extension: String = "md" 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 fun formatLink(text: String, location: Location): String { val href = location.path.replace("\\", "/") .replaceAfterLast(".", "html") .replace("/index.html", "/"); return "${text}" } 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, lines: Iterable) { to.append("
")
        for (line in lines)
            to.appendln(line)
        to.append(to, "
") } override public fun appendBlockCode(to: StringBuilder, line: String) { 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): String { return "${formatText(text)}" } }