diff options
5 files changed, 41 insertions, 50 deletions
diff --git a/core/src/main/kotlin/pages/PageNodes.kt b/core/src/main/kotlin/pages/PageNodes.kt index 42ca25cc..d01a7c58 100644 --- a/core/src/main/kotlin/pages/PageNodes.kt +++ b/core/src/main/kotlin/pages/PageNodes.kt @@ -171,6 +171,8 @@ class MultimoduleRootPageNode( override val children: List<PageNode> = emptyList() + override val enforceDirectory: Boolean = false + override val documentable: Documentable? = null override fun modified(name: String, children: List<PageNode>): RootPageNode = diff --git a/plugins/base/src/main/kotlin/signatures/KotlinSignatureProvider.kt b/plugins/base/src/main/kotlin/signatures/KotlinSignatureProvider.kt index 04818ebb..a444d192 100644 --- a/plugins/base/src/main/kotlin/signatures/KotlinSignatureProvider.kt +++ b/plugins/base/src/main/kotlin/signatures/KotlinSignatureProvider.kt @@ -94,26 +94,24 @@ class KotlinSignatureProvider(ctcc: CommentsToContentConverter, logger: DokkaLog +buildSignature(it) } } - if (c is DClass) { - if (c is WithConstructors) { - val pConstructor = c.constructors.singleOrNull { it.extra[PrimaryConstructorExtra] != null } - if (pConstructor?.annotations()?.isNotEmpty() == true) { - text(nbsp.toString()) - annotationsInline(pConstructor) - text("constructor") - } - list( - pConstructor?.parameters.orEmpty(), - "(", - ")", - ",", - pConstructor?.sourceSets.orEmpty().toSet() - ) { - annotationsInline(it) - text(it.name ?: "", styles = mainStyles.plus(TextStyle.Bold)) - text(": ") - signatureForProjection(it.type) - } + if (c is WithConstructors) { + val pConstructor = c.constructors.singleOrNull { it.extra[PrimaryConstructorExtra] != null } + if (pConstructor?.annotations()?.values?.any { it.isNotEmpty() } == true) { + text(nbsp.toString()) + annotationsInline(pConstructor) + text("constructor") + } + list( + pConstructor?.parameters.orEmpty(), + "(", + ")", + ",", + pConstructor?.sourceSets.orEmpty().toSet() + ) { + annotationsInline(it) + text(it.name ?: "", styles = mainStyles.plus(TextStyle.Bold)) + text(": ") + signatureForProjection(it.type) } } if (c is WithSupertypes) { diff --git a/plugins/base/src/main/resources/dokka/styles/style.css b/plugins/base/src/main/resources/dokka/styles/style.css index f180762b..d47d925f 100644 --- a/plugins/base/src/main/resources/dokka/styles/style.css +++ b/plugins/base/src/main/resources/dokka/styles/style.css @@ -233,6 +233,7 @@ display: flex; padding: 8px 8px 8px 16px; box-sizing: border-box; + white-space: pre-wrap; font-weight: bold; position: relative; line-height: 24px; diff --git a/plugins/base/src/test/kotlin/content/signatures/SkippingParenthesisForConstructorsTest.kt b/plugins/base/src/test/kotlin/content/signatures/SkippingParenthesisForConstructorsTest.kt index d1e4dad8..b96b5b46 100644 --- a/plugins/base/src/test/kotlin/content/signatures/SkippingParenthesisForConstructorsTest.kt +++ b/plugins/base/src/test/kotlin/content/signatures/SkippingParenthesisForConstructorsTest.kt @@ -36,10 +36,8 @@ class ConstructorsSignaturesTest : AbstractCoreTest() { header(1) { +"SomeClass" } platformHinted { group { - group { - +"class" - link { +"SomeClass" } - } + +"class" + link { +"SomeClass" } } } } @@ -68,10 +66,8 @@ class ConstructorsSignaturesTest : AbstractCoreTest() { header(1) { +"SomeClass" } platformHinted { group { - group { - +"class" - link { +"SomeClass" } - } + +"class" + link { +"SomeClass" } } } } @@ -100,13 +96,11 @@ class ConstructorsSignaturesTest : AbstractCoreTest() { header(1) { +"SomeClass" } platformHinted { group { - group { - +"class" - link { +"SomeClass" } - +"(a:" - group { link { +"String" } } - +")" - } + +"class" + link { +"SomeClass" } + +"(a:" + group { link { +"String" } } + +")" } } } @@ -135,13 +129,11 @@ class ConstructorsSignaturesTest : AbstractCoreTest() { header(1) { +"SomeClass" } platformHinted { group { - group { - +"class" - link { +"SomeClass" } - +"(a:" // TODO: Make sure if we still do not want to have "val" here - group { link { +"String" } } - +")" - } + +"class" + link { +"SomeClass" } + +"(a:" // TODO: Make sure if we still do not want to have "val" here + group { link { +"String" } } + +")" } } } @@ -171,13 +163,11 @@ class ConstructorsSignaturesTest : AbstractCoreTest() { header(1) { +"SomeClass" } platformHinted { group { - group { - +"class" - link { +"SomeClass" } - +"(a:" - group { link { +"String" } } - +")" - } + +"class" + link { +"SomeClass" } + +"(a:" + group { link { +"String" } } + +")" } } } diff --git a/plugins/base/src/test/kotlin/utils/contentUtils.kt b/plugins/base/src/test/kotlin/utils/contentUtils.kt index c7cea1f1..37f7881b 100644 --- a/plugins/base/src/test/kotlin/utils/contentUtils.kt +++ b/plugins/base/src/test/kotlin/utils/contentUtils.kt @@ -178,7 +178,7 @@ fun ContentMatcherBuilder<*>.unnamedTag(tag: String, content: ContentMatcherBuil group { content() } } -private fun ContentMatcherBuilder<*>.unwrapAnnotation(elem: Map.Entry<String, Set<String>>) { +fun ContentMatcherBuilder<*>.unwrapAnnotation(elem: Map.Entry<String, Set<String>>) { group { +"@" link { +elem.key } |