From 732d181e4908ed0ddc513e305addc71560c0e109 Mon Sep 17 00:00:00 2001 From: "sebastian.sellmair" Date: Wed, 26 Aug 2020 16:56:39 +0200 Subject: Let root package be represented as [root] to the user --- .../main/kotlin/org/jetbrains/dokka/javadoc/JavadocPageCreator.kt | 2 +- .../kotlin/org/jetbrains/dokka/javadoc/pages/JavadocPageNodes.kt | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) (limited to 'plugins/javadoc/src/main') diff --git a/plugins/javadoc/src/main/kotlin/org/jetbrains/dokka/javadoc/JavadocPageCreator.kt b/plugins/javadoc/src/main/kotlin/org/jetbrains/dokka/javadoc/JavadocPageCreator.kt index 05de8fa1..2fb00335 100644 --- a/plugins/javadoc/src/main/kotlin/org/jetbrains/dokka/javadoc/JavadocPageCreator.kt +++ b/plugins/javadoc/src/main/kotlin/org/jetbrains/dokka/javadoc/JavadocPageCreator.kt @@ -84,7 +84,7 @@ open class JavadocPageCreator( leafList(setOf(m.dri), ContentKind.Packages, JavadocList( "Packages", "Package", - m.packages.sortedBy { it.name }.map { p -> + m.packages.sortedBy { it.packageName }.map { p -> RowJavadocListEntry( LinkJavadocListEntry(p.name, setOf(p.dri), JavadocContentKind.PackageSummary, sourceSets), p.brief() diff --git a/plugins/javadoc/src/main/kotlin/org/jetbrains/dokka/javadoc/pages/JavadocPageNodes.kt b/plugins/javadoc/src/main/kotlin/org/jetbrains/dokka/javadoc/pages/JavadocPageNodes.kt index 3875c307..2f26ea79 100644 --- a/plugins/javadoc/src/main/kotlin/org/jetbrains/dokka/javadoc/pages/JavadocPageNodes.kt +++ b/plugins/javadoc/src/main/kotlin/org/jetbrains/dokka/javadoc/pages/JavadocPageNodes.kt @@ -74,6 +74,10 @@ class JavadocPackagePageNode( NavigableJavadocNode, PackagePage { + init { + require(name.isNotBlank()) { "Empty name is not supported " } + } + override fun getAllNavigables(): List = children.filterIsInstance().flatMap { if (it is WithNavigable) it.getAllNavigables() @@ -568,4 +572,4 @@ private fun Documentable.kind(): String? = is DObject -> "object" is DInterface -> "interface" else -> null - } \ No newline at end of file + } -- cgit