diff --git a/.changes/30477ab1-a876-4671-9c89-fcfc3c6ff3b8.json b/.changes/30477ab1-a876-4671-9c89-fcfc3c6ff3b8.json new file mode 100644 index 00000000000..79a2c18623e --- /dev/null +++ b/.changes/30477ab1-a876-4671-9c89-fcfc3c6ff3b8.json @@ -0,0 +1,5 @@ +{ + "id": "30477ab1-a876-4671-9c89-fcfc3c6ff3b8", + "type": "documentation", + "description": "update API reference doc styling" +} \ No newline at end of file diff --git a/aws-runtime/aws-config/build.gradle.kts b/aws-runtime/aws-config/build.gradle.kts index 14b58fdd925..694b9b0ba5d 100644 --- a/aws-runtime/aws-config/build.gradle.kts +++ b/aws-runtime/aws-config/build.gradle.kts @@ -3,6 +3,7 @@ * SPDX-License-Identifier: Apache-2.0. */ import aws.sdk.kotlin.gradle.codegen.dsl.smithyKotlinPlugin +import org.jetbrains.dokka.gradle.DokkaTaskPartial plugins { id("aws.sdk.kotlin.codegen") @@ -187,3 +188,13 @@ listOf("apiElements", "runtimeElements").forEach { } } + +// suppress internal generated clients +tasks.named("dokkaHtmlPartial") { + dokkaSourceSets.configureEach { + perPackageOption { + matchingRegex.set(""".*\.internal.*""") + suppress.set(true) + } + } +} \ No newline at end of file diff --git a/build.gradle.kts b/build.gradle.kts index a67071805fe..da14d48f827 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -25,7 +25,10 @@ allprojects { val pluginConfigMap = mapOf( "org.jetbrains.dokka.base.DokkaBase" to """ { - "customStyleSheets": ["${rootProject.file("docs/dokka-presets/css/logo-styles.css")}"], + "customStyleSheets": [ + "${rootProject.file("docs/dokka-presets/css/logo-styles.css")}", + "${rootProject.file("docs/dokka-presets/css/aws-styles.css")}" + ], "customAssets": [ "${rootProject.file("docs/dokka-presets/assets/logo-icon.svg")}", "${rootProject.file("docs/dokka-presets/assets/aws_logo_white_59x35.png")}" @@ -90,19 +93,21 @@ if (project.prop("kotlinWarningsAsErrors")?.toString()?.toBoolean() == true) { } } -// configure the root multimodule docs -tasks.dokkaHtmlMultiModule.configure { - moduleName.set("AWS SDK for Kotlin") +project.afterEvaluate { + // configure the root multimodule docs + tasks.dokkaHtmlMultiModule.configure { + moduleName.set("AWS SDK for Kotlin") - includes.from( - // NOTE: these get concatenated - rootProject.file("docs/dokka-presets/README.md"), - ) + includes.from( + // NOTE: these get concatenated + rootProject.file("docs/dokka-presets/README.md"), + ) - val excludeFromDocumentation = listOf( - project(":aws-runtime:testing"), - ) - removeChildTasks(excludeFromDocumentation) + val excludeFromDocumentation = listOf( + project(":aws-runtime:testing") + ) + removeChildTasks(excludeFromDocumentation) + } } if ( diff --git a/docs/dokka-presets/css/aws-styles.css b/docs/dokka-presets/css/aws-styles.css new file mode 100644 index 00000000000..5e99228bc0e --- /dev/null +++ b/docs/dokka-presets/css/aws-styles.css @@ -0,0 +1,9 @@ +/* + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0. + */ + + +:root { + --color-dark: #232f3e; +} diff --git a/docs/dokka-presets/css/logo-styles.css b/docs/dokka-presets/css/logo-styles.css index ffccc648e7e..e2871d45d3c 100644 --- a/docs/dokka-presets/css/logo-styles.css +++ b/docs/dokka-presets/css/logo-styles.css @@ -3,23 +3,20 @@ * SPDX-License-Identifier: Apache-2.0. */ -#logo { - background-image: url('../images/aws_logo_white_59x35.png'); - background-color: #232f3e; - color: #333; - background-size: 59px 35px; +.library-name a { + position: relative; + --logo-width: 72px; + margin-left: calc(var(--logo-width) + 5px); } -body { - background-color: #f2f3f3; +.library-name a::before { + content: ''; + /* path is relative to final asset location output dir */ + background-image: url('../images/aws_logo_white_59x35.png'); + background-size: contain; + position: absolute; + width: 59px; + height: 35px; + top: -10px; + left: calc(-1 * var(--logo-width) - 5px); } - -/* - * override markdown samples which appear to have broken and/or minimal style - */ -.sample-container { - padding: 16px; - border-radius: 6px; - background-color: rgb(280, 280, 280); - margin: 12px 0 12px 0; -} \ No newline at end of file diff --git a/services/build.gradle.kts b/services/build.gradle.kts index dcf6e3637a3..3ddf075b187 100644 --- a/services/build.gradle.kts +++ b/services/build.gradle.kts @@ -52,6 +52,15 @@ subprojects { } } + tasks.withType().configureEach { + dokkaSourceSets { + named("main") { + platform.set(org.jetbrains.dokka.Platform.jvm) + sourceRoots.from(kotlin.sourceSets.getByName("main").kotlin.srcDirs) + } + } + } + tasks.test { useJUnitPlatform() testLogging {