aboutsummaryrefslogtreecommitdiff
path: root/src/Generation/ConsoleGenerator.kt
diff options
context:
space:
mode:
Diffstat (limited to 'src/Generation/ConsoleGenerator.kt')
-rw-r--r--src/Generation/ConsoleGenerator.kt27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/Generation/ConsoleGenerator.kt b/src/Generation/ConsoleGenerator.kt
new file mode 100644
index 00000000..e46cac31
--- /dev/null
+++ b/src/Generation/ConsoleGenerator.kt
@@ -0,0 +1,27 @@
+package org.jetbrains.dokka
+
+public class ConsoleGenerator() {
+ val IndentStep = " "
+
+ public fun generate(node: DocumentationNode, indent: String = "") {
+ generateHeader(node, indent)
+ generateDetails(node, indent)
+ generateMembers(node, indent)
+ }
+
+ public fun generateHeader(node: DocumentationNode, indent: String = "") {
+ println("$indent${node.kind}: ${node.name}")
+ println("$indent\"${node.doc.replace("\n", "\n$indent")}\"")
+ println()
+ }
+
+ public fun generateDetails(node: DocumentationNode, indent: String = "") {
+ for (child in node.details)
+ generate(child, indent + IndentStep)
+ }
+
+ public fun generateMembers(node: DocumentationNode, indent: String = "") {
+ for (child in node.members)
+ generate(child, indent + IndentStep)
+ }
+} \ No newline at end of file