diff options
author | Dmitry Jemerov <yole@jetbrains.com> | 2015-01-16 16:55:22 +0100 |
---|---|---|
committer | Dmitry Jemerov <yole@jetbrains.com> | 2015-01-16 16:55:22 +0100 |
commit | 82de2309e53df4206e99beb36ef51326dbae48a2 (patch) | |
tree | ffca7f8610e5f9527d553a9b88f5fe347cbd8647 /src/Generation/FileGenerator.kt | |
parent | d75cc63e9b1edc229fad225956ba44fa433e2d0e (diff) | |
download | dokka-82de2309e53df4206e99beb36ef51326dbae48a2.tar.gz dokka-82de2309e53df4206e99beb36ef51326dbae48a2.tar.bz2 dokka-82de2309e53df4206e99beb36ef51326dbae48a2.zip |
refactor outline generation; generate HTML outline
Diffstat (limited to 'src/Generation/FileGenerator.kt')
-rw-r--r-- | src/Generation/FileGenerator.kt | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/Generation/FileGenerator.kt b/src/Generation/FileGenerator.kt index ac146503..128f3260 100644 --- a/src/Generation/FileGenerator.kt +++ b/src/Generation/FileGenerator.kt @@ -5,7 +5,8 @@ import java.io.OutputStreamWriter public class FileGenerator(val signatureGenerator: LanguageService, val locationService: LocationService, - val formatService: FormatService) { + val formatService: FormatService, + val outlineService: OutlineFormatService?) { public fun buildPage(node: DocumentationNode): Unit = buildPages(listOf(node)) public fun buildOutline(node: DocumentationNode): Unit = buildOutlines(listOf(node)) @@ -24,12 +25,15 @@ public class FileGenerator(val signatureGenerator: LanguageService, } public fun buildOutlines(nodes: Iterable<DocumentationNode>) { + if (outlineService == null) { + return + } for ((location, items) in nodes.groupBy { locationService.location(it) }) { - val file = location.file.appendExtension("yml") // TODO: hardcoded + val file = outlineService.getOutlineFileName(location) file.getParentFile()?.mkdirs() FileOutputStream(file).use { OutputStreamWriter(it, Charsets.UTF_8).use { - it.write(formatService.formatOutline(location, items)) + it.write(outlineService.formatOutline(location, items)) } } } |