aboutsummaryrefslogtreecommitdiff
path: root/src/Formats/JekyllFormatService.kt
blob: 9386111341839eb12d8c6a166a87acb8a7594a64 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
package org.jetbrains.dokka

public open class JekyllFormatService(locationService: LocationService,
                                 signatureGenerator: LanguageService)
: MarkdownFormatService(locationService, signatureGenerator) {

    override fun link(from: DocumentationNode, to: DocumentationNode): FormatLink = link(from, to, "html")

    override fun appendNodes(location: Location, to: StringBuilder, nodes: Iterable<DocumentationNode>) {
        to.appendln("---")
        appendFrontMatter(nodes, to)
        to.appendln("---")
        to.appendln("")
        super<MarkdownFormatService>.appendNodes(location, to, nodes)
    }

    protected open fun appendFrontMatter(nodes: Iterable<DocumentationNode>, to: StringBuilder) {
        to.appendln("title: ${nodes.first().name}")
    }
}