aboutsummaryrefslogtreecommitdiff
path: root/src/Model
diff options
context:
space:
mode:
authorDmitry Jemerov <yole@jetbrains.com>2015-10-29 13:31:16 +0100
committerDmitry Jemerov <yole@jetbrains.com>2015-10-29 13:31:16 +0100
commit4e09ac20457e2c4398406a1c23bf1f435f31349e (patch)
tree87e074f00e3d31ac3c73a2b1d64ad7fc20375f8d /src/Model
parentc9d59e9ae85f76e021d53c77ef18bfce0ff7ec7c (diff)
parent8216501e9a07940ed0a0be3d204733df9a9d811c (diff)
downloaddokka-4e09ac20457e2c4398406a1c23bf1f435f31349e.tar.gz
dokka-4e09ac20457e2c4398406a1c23bf1f435f31349e.tar.bz2
dokka-4e09ac20457e2c4398406a1c23bf1f435f31349e.zip
Merge branch 'javadoc' of https://github.com/cy6erGn0m/dokka into cy6erGn0m-javadoc
# Conflicts: # dokka.iml # javadoc/javadoc.iml # javadoc/src/main/kotlin/docbase.kt # javadoc/src/main/kotlin/dokka-adapters.kt # javadoc/src/main/kotlin/reporter.kt # javadoc/src/main/kotlin/tags.kt # src/Analysis/AnalysisEnvironment.kt # src/Analysis/CompilerAPI.kt # src/Formats/KotlinWebsiteFormatService.kt # src/Formats/StructuredFormatService.kt # src/Java/JavaDocumentationBuilder.kt # src/Kotlin/ContentBuilder.kt # src/Kotlin/DocumentationBuilder.kt # src/Languages/JavaLanguageService.kt # src/Model/Content.kt # src/Model/PackageDocs.kt # src/Utilities/GuiceModule.kt # src/Utilities/Path.kt # src/Utilities/ServiceLocator.kt # test/src/markdown/MarkdownTestRunner.kt
Diffstat (limited to 'src/Model')
-rw-r--r--src/Model/Content.kt7
-rw-r--r--src/Model/DocumentationNode.kt5
2 files changed, 8 insertions, 4 deletions
diff --git a/src/Model/Content.kt b/src/Model/Content.kt
index e7dfc241..45d42a2d 100644
--- a/src/Model/Content.kt
+++ b/src/Model/Content.kt
@@ -126,6 +126,11 @@ public class ContentSection(public val tag: String, public val subjectName: Stri
children.hashCode() * 31 * 31 + tag.hashCode() * 31 + (subjectName?.hashCode() ?: 0)
}
+public object ContentTags {
+ val Description = "Description"
+ val SeeAlso = "See Also"
+}
+
fun content(body: ContentBlock.() -> Unit): ContentBlock {
val block = ContentBlock()
block.body()
@@ -189,7 +194,7 @@ public open class MutableContent() : Content() {
if (descriptionNodes.isEmpty()) {
ContentEmpty
} else {
- val result = ContentSection("Description", null)
+ val result = ContentSection(ContentTags.Description, null)
result.children.addAll(descriptionNodes)
result
}
diff --git a/src/Model/DocumentationNode.kt b/src/Model/DocumentationNode.kt
index 468cb878..4a77f761 100644
--- a/src/Model/DocumentationNode.kt
+++ b/src/Model/DocumentationNode.kt
@@ -123,9 +123,7 @@ public class DocumentationModule(name: String, content: Content = Content.Empty)
val DocumentationNode.path: List<DocumentationNode>
get() {
- val parent = owner
- if (parent == null)
- return listOf(this)
+ val parent = owner ?: return listOf(this)
return parent.path + this
}
@@ -143,6 +141,7 @@ fun DocumentationNode.findOrCreatePackageNode(packageName: String, packageConten
fun DocumentationNode.append(child: DocumentationNode, kind: DocumentationReference.Kind) {
addReferenceTo(child, kind)
+ @suppress("NON_EXHAUSTIVE_WHEN")
when (kind) {
DocumentationReference.Kind.Detail -> child.addReferenceTo(this, DocumentationReference.Kind.Owner)
DocumentationReference.Kind.Member -> child.addReferenceTo(this, DocumentationReference.Kind.Owner)