Skip to content

Commit 43486ea

Browse files
authored
docs: fix dokka styling and services not showing up (#592)
1 parent 7bc65bf commit 43486ea

File tree

6 files changed

+65
-29
lines changed

6 files changed

+65
-29
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"id": "30477ab1-a876-4671-9c89-fcfc3c6ff3b8",
3+
"type": "documentation",
4+
"description": "update API reference doc styling"
5+
}

aws-runtime/aws-config/build.gradle.kts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
* SPDX-License-Identifier: Apache-2.0.
44
*/
55
import aws.sdk.kotlin.gradle.codegen.dsl.smithyKotlinPlugin
6+
import org.jetbrains.dokka.gradle.DokkaTaskPartial
67

78
plugins {
89
id("aws.sdk.kotlin.codegen")
@@ -187,3 +188,13 @@ listOf("apiElements", "runtimeElements").forEach {
187188
}
188189
}
189190

191+
192+
// suppress internal generated clients
193+
tasks.named<DokkaTaskPartial>("dokkaHtmlPartial") {
194+
dokkaSourceSets.configureEach {
195+
perPackageOption {
196+
matchingRegex.set(""".*\.internal.*""")
197+
suppress.set(true)
198+
}
199+
}
200+
}

build.gradle.kts

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,10 @@ allprojects {
2525
val pluginConfigMap = mapOf(
2626
"org.jetbrains.dokka.base.DokkaBase" to """
2727
{
28-
"customStyleSheets": ["${rootProject.file("docs/dokka-presets/css/logo-styles.css")}"],
28+
"customStyleSheets": [
29+
"${rootProject.file("docs/dokka-presets/css/logo-styles.css")}",
30+
"${rootProject.file("docs/dokka-presets/css/aws-styles.css")}"
31+
],
2932
"customAssets": [
3033
"${rootProject.file("docs/dokka-presets/assets/logo-icon.svg")}",
3134
"${rootProject.file("docs/dokka-presets/assets/aws_logo_white_59x35.png")}"
@@ -90,19 +93,21 @@ if (project.prop("kotlinWarningsAsErrors")?.toString()?.toBoolean() == true) {
9093
}
9194
}
9295

93-
// configure the root multimodule docs
94-
tasks.dokkaHtmlMultiModule.configure {
95-
moduleName.set("AWS SDK for Kotlin")
96+
project.afterEvaluate {
97+
// configure the root multimodule docs
98+
tasks.dokkaHtmlMultiModule.configure {
99+
moduleName.set("AWS SDK for Kotlin")
96100

97-
includes.from(
98-
// NOTE: these get concatenated
99-
rootProject.file("docs/dokka-presets/README.md"),
100-
)
101+
includes.from(
102+
// NOTE: these get concatenated
103+
rootProject.file("docs/dokka-presets/README.md"),
104+
)
101105

102-
val excludeFromDocumentation = listOf(
103-
project(":aws-runtime:testing"),
104-
)
105-
removeChildTasks(excludeFromDocumentation)
106+
val excludeFromDocumentation = listOf(
107+
project(":aws-runtime:testing")
108+
)
109+
removeChildTasks(excludeFromDocumentation)
110+
}
106111
}
107112

108113
if (
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
/*
2+
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3+
* SPDX-License-Identifier: Apache-2.0.
4+
*/
5+
6+
7+
:root {
8+
--color-dark: #232f3e;
9+
}

docs/dokka-presets/css/logo-styles.css

Lines changed: 14 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,20 @@
33
* SPDX-License-Identifier: Apache-2.0.
44
*/
55

6-
#logo {
7-
background-image: url('../images/aws_logo_white_59x35.png');
8-
background-color: #232f3e;
9-
color: #333;
10-
background-size: 59px 35px;
6+
.library-name a {
7+
position: relative;
8+
--logo-width: 72px;
9+
margin-left: calc(var(--logo-width) + 5px);
1110
}
1211

13-
body {
14-
background-color: #f2f3f3;
12+
.library-name a::before {
13+
content: '';
14+
/* path is relative to final asset location output dir */
15+
background-image: url('../images/aws_logo_white_59x35.png');
16+
background-size: contain;
17+
position: absolute;
18+
width: 59px;
19+
height: 35px;
20+
top: -10px;
21+
left: calc(-1 * var(--logo-width) - 5px);
1522
}
16-
17-
/*
18-
* override markdown samples which appear to have broken and/or minimal style
19-
*/
20-
.sample-container {
21-
padding: 16px;
22-
border-radius: 6px;
23-
background-color: rgb(280, 280, 280);
24-
margin: 12px 0 12px 0;
25-
}

services/build.gradle.kts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,15 @@ subprojects {
5252
}
5353
}
5454

55+
tasks.withType<org.jetbrains.dokka.gradle.DokkaTaskPartial>().configureEach {
56+
dokkaSourceSets {
57+
named("main") {
58+
platform.set(org.jetbrains.dokka.Platform.jvm)
59+
sourceRoots.from(kotlin.sourceSets.getByName("main").kotlin.srcDirs)
60+
}
61+
}
62+
}
63+
5564
tasks.test {
5665
useJUnitPlatform()
5766
testLogging {

0 commit comments

Comments
 (0)