From 79463f06a953de2f2c2ec877f34deaed658b3471 Mon Sep 17 00:00:00 2001 From: Marcin Aman Date: Thu, 12 Aug 2021 14:49:26 +0200 Subject: Remove unused components, docs, change icon to new kotlin logo and add hamburger for mobile --- docs/src/doc/docs/user_guide/base-specific/frontend.md | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) (limited to 'docs') diff --git a/docs/src/doc/docs/user_guide/base-specific/frontend.md b/docs/src/doc/docs/user_guide/base-specific/frontend.md index 62f72af1..dc1b0c2e 100644 --- a/docs/src/doc/docs/user_guide/base-specific/frontend.md +++ b/docs/src/doc/docs/user_guide/base-specific/frontend.md @@ -24,7 +24,6 @@ Dokka uses 3 stylesheets: * `style.css` - main css file responsible for styling the page * `jetbrains-mono.css` - fonts used across dokka -* `logo-styles.css` - logo styling User can choose to add or override those files. Resources will be overridden when in `pluginConfiguration` block there is a resource with the same name. @@ -37,15 +36,4 @@ Keep in mind that this value will be pased exactly to the output html, so it has ## Separating inherited members By setting a boolean property `separateInheritedMembers` dokka will split inherited members (like functions, properties etc.) -from ones declared in viewed class. Separated members will have it's own tabs on the page. - -### Examples -In order to override a logo and style it accordingly a simple css file named `logo-styles.css` is needed: -```css -#logo { - background-image: url('https://upload.wikimedia.org/wikipedia/commons/9/9d/Ubuntu_logo.svg'); - /* other styles required to make your page pretty */ -} -``` - -For build system specific instructions please visit dedicated pages: [gradle](../gradle/usage.md#Applying plugins), [maven](../maven/usage.md#Applying plugins) and [cli](../cli/usage.md#Configuration options) +from ones declared in viewed class. Separated members will have it's own tabs on the page. \ No newline at end of file -- cgit From 9044761979d08b3b116c9f8416dfb42ae216898c Mon Sep 17 00:00:00 2001 From: Marcin Aman Date: Sat, 21 Aug 2021 15:57:01 +0200 Subject: Review comments + "unspecified" version fix --- .../doc/docs/user_guide/base-specific/frontend.md | 7 +++++-- .../main/kotlin/renderers/html/htmlFormatingUtils.kt | 8 +------- .../kotlin/signatures/KotlinSignatureProvider.kt | 2 +- .../jetbrains/dokka/gradle/DokkaMultiModuleTask.kt | 2 +- .../org/jetbrains/dokka/gradle/DokkaProperty.kt | 2 ++ .../kotlin/org/jetbrains/dokka/gradle/DokkaTask.kt | 2 +- .../dokka/gradle/DokkaMultiModuleTaskTest.kt | 20 ++++++++++++++++---- 7 files changed, 27 insertions(+), 16 deletions(-) (limited to 'docs') diff --git a/docs/src/doc/docs/user_guide/base-specific/frontend.md b/docs/src/doc/docs/user_guide/base-specific/frontend.md index dc1b0c2e..63146013 100644 --- a/docs/src/doc/docs/user_guide/base-specific/frontend.md +++ b/docs/src/doc/docs/user_guide/base-specific/frontend.md @@ -31,9 +31,12 @@ Resources will be overridden when in `pluginConfiguration` block there is a reso ## Modifying footer Dokka supports custom messages in the footer via `footerMessage` string property on base plugin configuration. -Keep in mind that this value will be pased exactly to the output html, so it has to be valid and escaped correctly. +Keep in mind that this value will be passed exactly to the output html, so it has to be valid and escaped correctly. ## Separating inherited members By setting a boolean property `separateInheritedMembers` dokka will split inherited members (like functions, properties etc.) -from ones declared in viewed class. Separated members will have it's own tabs on the page. \ No newline at end of file +from ones declared in viewed class. Separated members will have it's own tabs on the page. + + +For build system specific instructions please visit dedicated pages: [gradle](../gradle/usage.md#Applying plugins), [maven](../maven/usage.md#Applying plugins) and [cli](../cli/usage.md#Configuration options) \ No newline at end of file diff --git a/plugins/base/src/main/kotlin/renderers/html/htmlFormatingUtils.kt b/plugins/base/src/main/kotlin/renderers/html/htmlFormatingUtils.kt index 19079241..d77426da 100644 --- a/plugins/base/src/main/kotlin/renderers/html/htmlFormatingUtils.kt +++ b/plugins/base/src/main/kotlin/renderers/html/htmlFormatingUtils.kt @@ -22,13 +22,7 @@ fun FlowContent.buildTextBreakableAfterCapitalLetters(name: String, hasLastEleme fun FlowContent.buildBreakableDotSeparatedHtml(name: String) { val phrases = name.split(".") phrases.forEachIndexed { i, e -> - val elementWithOptionalDot = - if (i != phrases.lastIndex) { - "$e." - } else { - e - } - + val elementWithOptionalDot = e.takeIf { i == phrases.lastIndex } ?: "$e." if (e.length > 10) { buildTextBreakableAfterCapitalLetters(elementWithOptionalDot, hasLastElement = i == phrases.lastIndex) } else { diff --git a/plugins/base/src/main/kotlin/signatures/KotlinSignatureProvider.kt b/plugins/base/src/main/kotlin/signatures/KotlinSignatureProvider.kt index a3770ca2..bd967518 100644 --- a/plugins/base/src/main/kotlin/signatures/KotlinSignatureProvider.kt +++ b/plugins/base/src/main/kotlin/signatures/KotlinSignatureProvider.kt @@ -176,7 +176,7 @@ class KotlinSignatureProvider(ctcc: CommentsToContentConverter, logger: DokkaLog pConstructor.sourceSets.toSet() ) { annotationsInline(it) - text(it.name ?: "") + text(it.name.orEmpty()) text(": ") signatureForProjection(it.type) } diff --git a/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/DokkaMultiModuleTask.kt b/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/DokkaMultiModuleTask.kt index cffc8bf3..76213f14 100644 --- a/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/DokkaMultiModuleTask.kt +++ b/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/DokkaMultiModuleTask.kt @@ -52,7 +52,7 @@ abstract class DokkaMultiModuleTask : AbstractDokkaParentTask() { override fun buildDokkaConfiguration(): DokkaConfigurationImpl = DokkaConfigurationImpl( moduleName = moduleName.getSafe(), - moduleVersion = moduleVersion.getSafe(), + moduleVersion = moduleVersion.getValidVersionOrNull(), outputDir = outputDirectory.getSafe(), cacheRoot = cacheRoot.getSafe(), pluginsConfiguration = buildPluginsConfiguration(), diff --git a/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/DokkaProperty.kt b/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/DokkaProperty.kt index b7e87c6c..51f6d297 100644 --- a/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/DokkaProperty.kt +++ b/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/DokkaProperty.kt @@ -19,3 +19,5 @@ internal inline fun Provider.getSafe(): T = if (typeOf().isMarkedNullable) orNull as T else get() +internal fun Provider.getValidVersionOrNull() = orNull?.takeIf { it != "unspecified" } + diff --git a/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/DokkaTask.kt b/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/DokkaTask.kt index 6bb946c3..af2d3b1b 100644 --- a/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/DokkaTask.kt +++ b/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/DokkaTask.kt @@ -9,7 +9,7 @@ abstract class DokkaTask : AbstractDokkaLeafTask() { override fun buildDokkaConfiguration(): DokkaConfigurationImpl = DokkaConfigurationImpl( moduleName = moduleName.getSafe(), - moduleVersion = moduleVersion.orNull?.takeIf { it != "unspecified" }, + moduleVersion = moduleVersion.getValidVersionOrNull(), outputDir = outputDirectory.getSafe(), cacheRoot = cacheRoot.getSafe(), offlineMode = offlineMode.getSafe(), diff --git a/runners/gradle-plugin/src/test/kotlin/org/jetbrains/dokka/gradle/DokkaMultiModuleTaskTest.kt b/runners/gradle-plugin/src/test/kotlin/org/jetbrains/dokka/gradle/DokkaMultiModuleTaskTest.kt index 97d1feea..73afdb43 100644 --- a/runners/gradle-plugin/src/test/kotlin/org/jetbrains/dokka/gradle/DokkaMultiModuleTaskTest.kt +++ b/runners/gradle-plugin/src/test/kotlin/org/jetbrains/dokka/gradle/DokkaMultiModuleTaskTest.kt @@ -6,10 +6,7 @@ import org.gradle.kotlin.dsl.* import org.gradle.testfixtures.ProjectBuilder import org.jetbrains.dokka.* import java.io.File -import kotlin.test.Test -import kotlin.test.assertEquals -import kotlin.test.assertFailsWith -import kotlin.test.assertTrue +import kotlin.test.* class DokkaMultiModuleTaskTest { @@ -99,6 +96,21 @@ class DokkaMultiModuleTaskTest { ) } + @Test + fun `multimodule task should not include unspecified version`(){ + childDokkaTask.apply { + dokkaSourceSets.create("main") + dokkaSourceSets.create("test") + } + + multiModuleTask.apply { + moduleVersion by "unspecified" + } + + val dokkaConfiguration = multiModuleTask.buildDokkaConfiguration() + assertNull(dokkaConfiguration.moduleVersion) + } + @Test fun `setting dokkaTaskNames declares proper task dependencies`() { val dependenciesInitial = multiModuleTask.taskDependencies.getDependencies(multiModuleTask).toSet() -- cgit