aboutsummaryrefslogtreecommitdiff
path: root/src/Model/DocumentationNode.kt
diff options
context:
space:
mode:
authorDmitry Jemerov <yole@jetbrains.com>2015-03-23 18:52:05 +0100
committerDmitry Jemerov <yole@jetbrains.com>2015-03-23 18:52:05 +0100
commit76e4d3cbc7cbbe1d35fb2e0c1ba59d3c86e0daf2 (patch)
treeefc5fc2e5dce290fbca9d55c12f0056b96735c3b /src/Model/DocumentationNode.kt
parent73bd875b621fedce84015c50b6954509f4978a6d (diff)
downloaddokka-76e4d3cbc7cbbe1d35fb2e0c1ba59d3c86e0daf2.tar.gz
dokka-76e4d3cbc7cbbe1d35fb2e0c1ba59d3c86e0daf2.tar.bz2
dokka-76e4d3cbc7cbbe1d35fb2e0c1ba59d3c86e0daf2.zip
parse included Markdown files to retrieve documentation for modules and packages
Diffstat (limited to 'src/Model/DocumentationNode.kt')
-rw-r--r--src/Model/DocumentationNode.kt6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/Model/DocumentationNode.kt b/src/Model/DocumentationNode.kt
index 9e8a981f..6800abef 100644
--- a/src/Model/DocumentationNode.kt
+++ b/src/Model/DocumentationNode.kt
@@ -119,12 +119,14 @@ val DocumentationNode.path: List<DocumentationNode>
return parent.path + this
}
-fun DocumentationNode.findOrCreatePackageNode(packageName: String): DocumentationNode {
+fun DocumentationNode.findOrCreatePackageNode(packageName: String, packageContent: Map<String, Content>): DocumentationNode {
val existingNode = members(DocumentationNode.Kind.Package).firstOrNull { it.name == packageName }
if (existingNode != null) {
return existingNode
}
- val newNode = DocumentationNode(packageName, Content.Empty, DocumentationNode.Kind.Package)
+ val newNode = DocumentationNode(packageName,
+ packageContent.getOrElse(packageName) { Content.Empty },
+ DocumentationNode.Kind.Package)
append(newNode, DocumentationReference.Kind.Member)
return newNode
}