diff options
Diffstat (limited to 'src/Model/DocumentationNode.kt')
-rw-r--r-- | src/Model/DocumentationNode.kt | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/Model/DocumentationNode.kt b/src/Model/DocumentationNode.kt index f0c3ddf5..8fec29c4 100644 --- a/src/Model/DocumentationNode.kt +++ b/src/Model/DocumentationNode.kt @@ -3,11 +3,14 @@ package org.jetbrains.dokka import java.util.LinkedHashSet public open class DocumentationNode(val name: String, - val content: Content, + content: Content, val kind: DocumentationNode.Kind) { private val references = LinkedHashSet<DocumentationReference>() + var content: Content = content + private set + public val summary: ContentNode get() = content.summary public val owner: DocumentationNode? @@ -38,6 +41,13 @@ public open class DocumentationNode(val name: String, references.addAll(other.references) } + public fun updateContent(body: MutableContent.() -> Unit) { + if (content !is MutableContent) { + content = MutableContent() + } + (content as MutableContent).body() + } + public fun details(kind: DocumentationNode.Kind): List<DocumentationNode> = details.filter { it.kind == kind } public fun members(kind: DocumentationNode.Kind): List<DocumentationNode> = members.filter { it.kind == kind } public fun links(kind: DocumentationNode.Kind): List<DocumentationNode> = links.filter { it.kind == kind } |