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.append("
")
to.append(line)
to.append("
")
}
override fun appendBlockCode(to: StringBuilder, lines: Iterable) {
to.append("")
to.append(lines.join("\n"))
to.append("
")
}
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("")
}
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 formatStrong(text: String): String {
return "${text}"
}
override fun formatEmphasis(text: String): String {
return "${text}"
}
override fun formatCode(code: String): String {
return "${code.htmlEscape()}
"
}
override fun formatList(text: String): String {
return ""
}
override fun formatListItem(text: String): String {
return "${text}"
}
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) {
}
}