From 76e4d3cbc7cbbe1d35fb2e0c1ba59d3c86e0daf2 Mon Sep 17 00:00:00 2001 From: Dmitry Jemerov Date: Mon, 23 Mar 2015 18:52:05 +0100 Subject: parse included Markdown files to retrieve documentation for modules and packages --- src/Model/DocumentationNode.kt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/Model/DocumentationNode.kt') 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 return parent.path + this } -fun DocumentationNode.findOrCreatePackageNode(packageName: String): DocumentationNode { +fun DocumentationNode.findOrCreatePackageNode(packageName: String, packageContent: Map): 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 } -- cgit