package org.jetbrains.dokka public open class HtmlFormatService(locationService: LocationService, signatureGenerator: LanguageService, val templateService: HtmlTemplateService = HtmlTemplateService.default()) : StructuredFormatService(locationService, signatureGenerator) { override val extension: String = "html" override public fun formatText(text: String): String { return text.htmlEscape() } 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)}" } override fun appendBlockCode(to: StringBuilder, line: String) { to.appendln("") to.appendln(line) to.appendln("") } override fun appendBlockCode(to: StringBuilder, lines: Iterable) { to.appendln("") to.appendln(lines.join("\n")) to.appendln("") } override fun appendHeader(to: StringBuilder, text: String, level: Int) { to.appendln("${text}") } override fun appendText(to: StringBuilder, text: String) { to.appendln("

${text}

") } override fun appendLine(to: StringBuilder, text: String) { to.appendln("${text}
") } override fun appendLine(to: StringBuilder) { to.appendln("
") } 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("") } override fun formatLink(text: String, location: Location): String { return "${text}" } override fun formatLink(text: String, href: String): String { return "${text}" } override fun formatBold(text: String): String { return "${text}" } override fun formatCode(code: String): String { return "${code.htmlEscape()}" } override fun formatBreadcrumbs(items: Iterable): String { return items.map { formatLink(it) }.joinToString(" / ") } override fun appendNodes(location: Location, to: StringBuilder, nodes: Iterable) { templateService.appendHeader(to) super.appendNodes(location, to, nodes) templateService.appendFooter(to) } override fun appendOutlineChildren(to: StringBuilder, nodes: Iterable) { } override fun appendOutlineHeader(to: StringBuilder, node: DocumentationNode) { } }