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

import com.google.inject.Inject

open class JekyllFormatService
    @Inject constructor(locationService: LocationService,
                        signatureGenerator: LanguageService,
                        linkExtension: String = "md")
: MarkdownFormatService(locationService, signatureGenerator, linkExtension) {

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

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