diff options
Diffstat (limited to 'core/src/main/kotlin/Model')
-rw-r--r-- | core/src/main/kotlin/Model/Content.kt | 8 | ||||
-rw-r--r-- | core/src/main/kotlin/Model/DocumentationNode.kt | 8 | ||||
-rw-r--r-- | core/src/main/kotlin/Model/PackageDocs.kt | 4 |
3 files changed, 10 insertions, 10 deletions
diff --git a/core/src/main/kotlin/Model/Content.kt b/core/src/main/kotlin/Model/Content.kt index 8312b2e2..5530e1b4 100644 --- a/core/src/main/kotlin/Model/Content.kt +++ b/core/src/main/kotlin/Model/Content.kt @@ -171,10 +171,10 @@ class ContentSection(val tag: String, val subjectName: String?) : ContentBlock() } object ContentTags { - val Description = "Description" - val SeeAlso = "See Also" - val Return = "Return" - val Exceptions = "Exceptions" + const val Description = "Description" + const val SeeAlso = "See Also" + const val Return = "Return" + const val Exceptions = "Exceptions" } fun content(body: ContentBlock.() -> Unit): ContentBlock { diff --git a/core/src/main/kotlin/Model/DocumentationNode.kt b/core/src/main/kotlin/Model/DocumentationNode.kt index 1ff14ff1..311b46e4 100644 --- a/core/src/main/kotlin/Model/DocumentationNode.kt +++ b/core/src/main/kotlin/Model/DocumentationNode.kt @@ -177,10 +177,10 @@ open class DocumentationNode(val name: String, fun inheritedCompanionObjectMembers(kind: NodeKind): List<DocumentationNode> = inheritedCompanionObjectMembers.filter { it.kind == kind } fun links(kind: NodeKind): List<DocumentationNode> = links.filter { it.kind == kind } - fun detail(kind: NodeKind): DocumentationNode = details.filter { it.kind == kind }.single() - fun detailOrNull(kind: NodeKind): DocumentationNode? = details.filter { it.kind == kind }.singleOrNull() - fun member(kind: NodeKind): DocumentationNode = members.filter { it.kind == kind }.single() - fun link(kind: NodeKind): DocumentationNode = links.filter { it.kind == kind }.single() + fun detail(kind: NodeKind): DocumentationNode = details.single { it.kind == kind } + fun detailOrNull(kind: NodeKind): DocumentationNode? = details.singleOrNull { it.kind == kind } + fun member(kind: NodeKind): DocumentationNode = members.single { it.kind == kind } + fun link(kind: NodeKind): DocumentationNode = links.single { it.kind == kind } fun references(kind: RefKind): List<DocumentationReference> = references.filter { it.kind == kind } diff --git a/core/src/main/kotlin/Model/PackageDocs.kt b/core/src/main/kotlin/Model/PackageDocs.kt index 5b628914..cf6cd808 100644 --- a/core/src/main/kotlin/Model/PackageDocs.kt +++ b/core/src/main/kotlin/Model/PackageDocs.kt @@ -41,7 +41,7 @@ class PackageDocs targetContent = findTargetContent(headingText.trimStart()) } } else { - buildContentTo(it, targetContent, LinkResolver(linkMap, { resolveContentLink(fileName, it, linkResolveContext) })) + buildContentTo(it, targetContent, LinkResolver(linkMap) { resolveContentLink(fileName, it, linkResolveContext) }) } } } else { @@ -118,7 +118,7 @@ class PackageDocs } private fun findOrCreatePackageContent(packageName: String) = - _packageContent.getOrPut(packageName) { -> MutableContent() } + _packageContent.getOrPut(packageName) { MutableContent() } private fun resolveContentLink(fileName: String, href: String, linkResolveContext: List<PackageFragmentDescriptor>): ContentBlock { if (linkResolver != null) { |