Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -445,6 +445,28 @@ constructor(
//endregion

companion object {
// only lower case keys based on source-set names
@Suppress("SpellCheckingInspection")
private val sourceSetNameReplacements = mapOf(
"jvm" to "JVM",
"js" to "JS",
"android" to "Android JVM",
"androidJvm" to "Android JVM",

"ios" to "iOS",
"watchos" to "watchOS",
"macos" to "macOS",
"tvos" to "tvOS",

"androidNative" to "Android Native",

"wasmjs" to "Wasm/JS",
"wasmwasi" to "Wasm/WASI",
)

private fun formatDefaultSourceSetName(name: String): String {
return sourceSetNameReplacements[name.toLowerCase()] ?: name.capitalize()
}

/**
* A factory for creating [DokkaSourceSetSpec].
Expand All @@ -462,11 +484,12 @@ constructor(
analysisPlatform.convention(KotlinPlatform.DEFAULT)
displayName.convention(
analysisPlatform.map { platform ->
if (name.equals("main", ignoreCase = true)) {
platform.displayName
} else {
name.removeSuffix("Main")
}
formatDefaultSourceSetName(
when {
name.equals("main", ignoreCase = true) -> platform.displayName
else -> name.removeSuffix("Main")
}
)
}
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,6 @@

cursor: pointer;

text-transform: capitalize;

border: 0 none;

border-radius: var(--size-s1);
Expand Down Expand Up @@ -72,15 +70,6 @@ button.platform-tag {
padding-left: 44px;
}

.platform-tag.js-like,
.platform-selector-option.js-like,
.platform-tag.jvm-like,
.platform-selector-option.jvm-like,
.platform-tag.wasm-like,
.platform-selector-option.wasm-like {
text-transform: uppercase;
}

.filter-section .platform-tag[data-active] {
color: #19191c;
background-color: var(--platform-tag-color);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -623,12 +623,12 @@ public open class HtmlRenderer(
div("platform-tags $cssClasses") {
sourceSets.sortedBy { it.name }.forEach {
div("platform-tag") {
when (it.platform.key) {
"common" -> classes = classes + "common-like"
"native" -> classes = classes + "native-like"
"jvm" -> classes = classes + "jvm-like"
"js" -> classes = classes + "js-like"
"wasm" -> classes = classes + "wasm-like"
classes += when (it.platform) {
Platform.common -> "common-like"
Platform.native -> "native-like"
Platform.jvm -> "jvm-like"
Platform.js -> "js-like"
Platform.wasm -> "wasm-like"
}
text(it.name)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2475,7 +2475,6 @@ a {
font: var(--font-text-s);
padding: 10px 12px;
position: relative;
text-transform: capitalize;
}

.platform-tags .platform-tag {
Expand Down Expand Up @@ -2504,10 +2503,6 @@ button.platform-tag:focus-visible {
padding-left: 44px;
}

.platform-selector-option.js-like, .platform-selector-option.jvm-like, .platform-selector-option.wasm-like, .platform-tag.js-like, .platform-tag.jvm-like, .platform-tag.wasm-like {
text-transform: uppercase;
}

.filter-section .platform-tag[data-active] {
background-color: var(--platform-tag-color);
color: #19191c;
Expand Down

Large diffs are not rendered by default.

Loading