aboutsummaryrefslogtreecommitdiff
path: root/src/Generation/FileGenerator.kt
diff options
context:
space:
mode:
Diffstat (limited to 'src/Generation/FileGenerator.kt')
-rw-r--r--src/Generation/FileGenerator.kt18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/Generation/FileGenerator.kt b/src/Generation/FileGenerator.kt
new file mode 100644
index 00000000..c1e88a76
--- /dev/null
+++ b/src/Generation/FileGenerator.kt
@@ -0,0 +1,18 @@
+package org.jetbrains.dokka
+
+import java.io.File
+
+public class FileGenerator(val signatureGenerator: SignatureGenerator,
+ val locationService: LocationService,
+ val formatService: FormatService) {
+ public fun generate(node: DocumentationNode) {
+ val location = locationService.location(node)
+ println("@${location.file} : ${signatureGenerator.render(node)}")
+ val file = location.file.appendExtension(formatService.extension)
+ file.getParentFile()?.mkdirs()
+ file.writeText(formatService.format(node), defaultCharset)
+ val items = node.members.sortBy { it.name }
+ for (child in items)
+ generate(child)
+ }
+} \ No newline at end of file