From eeb42e92f5eaf1c05f8102fec57d348feaca2e5c Mon Sep 17 00:00:00 2001 From: Ilya Ryzhenkov Date: Mon, 14 Jul 2014 22:29:34 +0400 Subject: Add jekyll format service --- src/Formats/JekyllFormatService.kt | 13 +++++++++++++ src/Formats/MarkdownFormatService.kt | 4 ++-- src/main.kt | 2 +- 3 files changed, 16 insertions(+), 3 deletions(-) create mode 100644 src/Formats/JekyllFormatService.kt (limited to 'src') 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, to: StringBuilder) { + to.appendln("---") + to.appendln("layout: post") + to.appendln("title: ${nodes.first().name}") + to.appendln("---") + super.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, 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) { 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) -- cgit