diff options
-rw-r--r-- | src/Formats/JekyllFormatService.kt | 13 | ||||
-rw-r--r-- | src/Formats/MarkdownFormatService.kt | 4 | ||||
-rw-r--r-- | src/main.kt | 2 |
3 files changed, 16 insertions, 3 deletions
diff --git a/src/Formats/JekyllFormatService.kt b/src/Formats/JekyllFormatService.kt new file mode 100644 index 00000000..19878154 --- /dev/null +++ b/src/Formats/JekyllFormatService.kt @@ -0,0 +1,13 @@ +package org.jetbrains.dokka + +public class JekyllFormatService(locationService: LocationService, signatureGenerator: SignatureGenerator) +: MarkdownFormatService(locationService, signatureGenerator) { + + override fun format(nodes: Iterable<DocumentationNode>, to: StringBuilder) { + to.appendln("---") + to.appendln("layout: post") + to.appendln("title: ${nodes.first().name}") + to.appendln("---") + super<MarkdownFormatService>.format(nodes, to) + } +}
\ No newline at end of file diff --git a/src/Formats/MarkdownFormatService.kt b/src/Formats/MarkdownFormatService.kt index ae1500f2..0fcfa444 100644 --- a/src/Formats/MarkdownFormatService.kt +++ b/src/Formats/MarkdownFormatService.kt @@ -3,8 +3,8 @@ package org.jetbrains.dokka import org.jetbrains.dokka.DocumentationNode.Kind import java.util.LinkedHashMap -public class MarkdownFormatService(val locationService: LocationService, - val signatureGenerator: SignatureGenerator) : FormatService { +public open class MarkdownFormatService(val locationService: LocationService, + val signatureGenerator: SignatureGenerator) : FormatService { override val extension: String = "md" override fun format(nodes: Iterable<DocumentationNode>, to: StringBuilder) { with (to) { diff --git a/src/main.kt b/src/main.kt index 3168aad4..9da545d7 100644 --- a/src/main.kt +++ b/src/main.kt @@ -57,7 +57,7 @@ public fun main(args: Array<String>) { val signatureGenerator = KotlinSignatureGenerator() val locationService = FoldersLocationService(arguments.outputDir) - val markdown = MarkdownFormatService(locationService, signatureGenerator) + val markdown = JekyllFormatService(locationService, signatureGenerator) val generator = FileGenerator(signatureGenerator, locationService, markdown) generator.generate(documentation) Disposer.dispose(environment) |