aboutsummaryrefslogtreecommitdiff
path: root/src/Formats/FormatService.kt
blob: 9af7459094e99e8f55a9b9c0358d1f3c5b0df02d (plain)
1
2
3
4
5
6
7
8
9
10
package org.jetbrains.dokka

public trait FormatService {
    val extension: String
    fun appendNodes(location: Location, to: StringBuilder, nodes: Iterable<DocumentationNode>)
    fun appendOutline(location: Location, to: StringBuilder, nodes: Iterable<DocumentationNode>)
}

fun FormatService.format(location: Location, nodes: Iterable<DocumentationNode>): String = StringBuilder { appendNodes(location, this, nodes) }.toString()
fun FormatService.formatOutline(location: Location, nodes: Iterable<DocumentationNode>): String = StringBuilder { appendOutline(location, this, nodes) }.toString()