aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorIlya Ryzhenkov <orangy@jetbrains.com>2014-07-12 03:10:02 +0400
committerIlya Ryzhenkov <orangy@jetbrains.com>2014-07-12 03:10:02 +0400
commit7bc3513935588467d4f848bbe40539664fdbdcf9 (patch)
tree1e905a011381c4bd746bf75b4567d1c1f6ca70e3 /src
parentb43d53e49ff1598d6b5add0542772701610d6f5c (diff)
downloaddokka-7bc3513935588467d4f848bbe40539664fdbdcf9.tar.gz
dokka-7bc3513935588467d4f848bbe40539664fdbdcf9.tar.bz2
dokka-7bc3513935588467d4f848bbe40539664fdbdcf9.zip
Do not generate empty sections in console output.
Diffstat (limited to 'src')
-rw-r--r--src/Generation/ConsoleGenerator.kt27
1 files changed, 19 insertions, 8 deletions
diff --git a/src/Generation/ConsoleGenerator.kt b/src/Generation/ConsoleGenerator.kt
index 36db88cf..90bd53be 100644
--- a/src/Generation/ConsoleGenerator.kt
+++ b/src/Generation/ConsoleGenerator.kt
@@ -1,7 +1,7 @@
package org.jetbrains.dokka
public class ConsoleGenerator() {
- val IndentStep = " "
+ val IndentStep = " |"
public fun generate(node: DocumentationNode, indent: String = "") {
generateHeader(node, indent)
@@ -16,18 +16,29 @@ public class ConsoleGenerator() {
println()
}
- public fun generateDetails(node: DocumentationNode, indent: String = "") {
- for (child in node.details)
+ public fun generateMembers(node: DocumentationNode, indent: String = "") {
+ val items = node.members
+ if (items.isEmpty())
+ return
+ println("$indent Members")
+ for (child in items)
generate(child, indent + IndentStep)
}
- public fun generateMembers(node: DocumentationNode, indent: String = "") {
- for (child in node.members)
- generate(child, indent + IndentStep)
+ public fun generateDetails(node: DocumentationNode, indent: String = "") {
+ val items = node.details
+ if (items.isEmpty())
+ return
+ for (child in items)
+ generate(child, indent + " ")
}
public fun generateLinks(node: DocumentationNode, indent: String = "") {
- for (child in node.links)
- generate(child, indent + IndentStep)
+ val items = node.links
+ if (items.isEmpty())
+ return
+ println("$indent Links")
+ for (child in items)
+ generate(child, indent + " ")
}
} \ No newline at end of file