aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorIlya Ryzhenkov <orangy@jetbrains.com>2014-07-14 22:29:34 +0400
committerIlya Ryzhenkov <orangy@jetbrains.com>2014-07-14 22:29:34 +0400
commiteeb42e92f5eaf1c05f8102fec57d348feaca2e5c (patch)
tree1a3f5f6dd85dbd2f0c5c5144122ebeff178f27c8 /src
parentc2c0910d611df770be1e3ef9d45cc4fb070d9e11 (diff)
downloaddokka-eeb42e92f5eaf1c05f8102fec57d348feaca2e5c.tar.gz
dokka-eeb42e92f5eaf1c05f8102fec57d348feaca2e5c.tar.bz2
dokka-eeb42e92f5eaf1c05f8102fec57d348feaca2e5c.zip
Add jekyll format service
Diffstat (limited to 'src')
-rw-r--r--src/Formats/JekyllFormatService.kt13
-rw-r--r--src/Formats/MarkdownFormatService.kt4
-rw-r--r--src/main.kt2
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)