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

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

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