aboutsummaryrefslogtreecommitdiff
path: root/plugins/javadoc/src
diff options
context:
space:
mode:
authorsebastian.sellmair <sebastian.sellmair@jetbrains.com>2020-08-26 16:56:39 +0200
committerSebastian Sellmair <34319766+sellmair@users.noreply.github.com>2020-08-31 15:10:04 +0200
commit732d181e4908ed0ddc513e305addc71560c0e109 (patch)
tree740c3ebe3fa05c3702b30faf07c4f6f87c97e432 /plugins/javadoc/src
parentf0524ce475695be163683cd1fdda2fab58ac0161 (diff)
downloaddokka-732d181e4908ed0ddc513e305addc71560c0e109.tar.gz
dokka-732d181e4908ed0ddc513e305addc71560c0e109.tar.bz2
dokka-732d181e4908ed0ddc513e305addc71560c0e109.zip
Let root package be represented as [root] to the user
Diffstat (limited to 'plugins/javadoc/src')
-rw-r--r--plugins/javadoc/src/main/kotlin/org/jetbrains/dokka/javadoc/JavadocPageCreator.kt2
-rw-r--r--plugins/javadoc/src/main/kotlin/org/jetbrains/dokka/javadoc/pages/JavadocPageNodes.kt6
2 files changed, 6 insertions, 2 deletions
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<NavigableJavadocNode> =
children.filterIsInstance<NavigableJavadocNode>().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
+ }