aboutsummaryrefslogtreecommitdiff
path: root/src/main.kt
diff options
context:
space:
mode:
authorDmitry Jemerov <intelliyole@gmail.com>2015-01-16 19:14:24 +0100
committerDmitry Jemerov <intelliyole@gmail.com>2015-01-16 19:14:24 +0100
commit5eab453ea82634af9b876bff26227ec2d0e753ca (patch)
treefed6a72ab7d4998b3acfffc2eafc0d01d2ee0ef0 /src/main.kt
parentd75cc63e9b1edc229fad225956ba44fa433e2d0e (diff)
parent29d0822f4521ac1a9d17f78be6e41488b2ef00d2 (diff)
downloaddokka-5eab453ea82634af9b876bff26227ec2d0e753ca.tar.gz
dokka-5eab453ea82634af9b876bff26227ec2d0e753ca.tar.bz2
dokka-5eab453ea82634af9b876bff26227ec2d0e753ca.zip
Merge pull request #23 from orangy/html-outline
refactor outline generation; generate HTML outline
Diffstat (limited to 'src/main.kt')
-rw-r--r--src/main.kt21
1 files changed, 13 insertions, 8 deletions
diff --git a/src/main.kt b/src/main.kt
index 989e8a36..4782c264 100644
--- a/src/main.kt
+++ b/src/main.kt
@@ -133,19 +133,24 @@ public fun main(args: Array<String>) {
val locationService = FoldersLocationService(arguments.outputDir)
val templateService = HtmlTemplateService.default("/dokka/styles/style.css")
- val formatter = when (arguments.outputFormat) {
- "text" -> TextFormatService(signatureGenerator)
- "html" -> HtmlFormatService(locationService, signatureGenerator, templateService)
- "markdown" -> MarkdownFormatService(locationService, signatureGenerator)
- "jekyll" -> JekyllFormatService(locationService, signatureGenerator)
- "kotlin-website" -> KotlinWebsiteFormatService(locationService, signatureGenerator)
+ val (formatter, outlineFormatter) = when (arguments.outputFormat) {
+ "text" -> TextFormatService(signatureGenerator) to null
+ "html" -> {
+ val htmlFormatService = HtmlFormatService(locationService, signatureGenerator, templateService)
+ htmlFormatService to htmlFormatService
+ }
+ "markdown" -> MarkdownFormatService(locationService, signatureGenerator) to null
+ "jekyll" -> JekyllFormatService(locationService, signatureGenerator) to null
+ "kotlin-website" -> KotlinWebsiteFormatService(locationService, signatureGenerator) to
+ YamlOutlineService(locationService, signatureGenerator)
else -> {
print("Unrecognized output format ${arguments.outputFormat}")
- return
+ null to null
}
}
+ if (formatter == null) return
- val generator = FileGenerator(signatureGenerator, locationService, formatter)
+ val generator = FileGenerator(signatureGenerator, locationService, formatter, outlineFormatter)
print("Generating pages... ")
generator.buildPage(documentation)
generator.buildOutline(documentation)