diff options
author | Dmitry Jemerov <yole@jetbrains.com> | 2015-03-23 18:52:05 +0100 |
---|---|---|
committer | Dmitry Jemerov <yole@jetbrains.com> | 2015-03-23 18:52:05 +0100 |
commit | 76e4d3cbc7cbbe1d35fb2e0c1ba59d3c86e0daf2 (patch) | |
tree | efc5fc2e5dce290fbca9d55c12f0056b96735c3b /src/Model/DocumentationNode.kt | |
parent | 73bd875b621fedce84015c50b6954509f4978a6d (diff) | |
download | dokka-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.kt | 6 |
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 } |