aboutsummaryrefslogtreecommitdiff
path: root/plugins/base/src/main/kotlin/translators/documentables/PageContentBuilder.kt
diff options
context:
space:
mode:
authorKamil Doległo <kamilok1965@interia.pl>2020-04-06 22:24:30 +0200
committerPaweł Marks <Kordyjan@users.noreply.github.com>2020-04-08 17:02:01 +0200
commita128cdd43265134a2a2c6b45f5d55b3543a9c794 (patch)
treeb5ad1118fcef7337f49054e5c92d3114e5af7019 /plugins/base/src/main/kotlin/translators/documentables/PageContentBuilder.kt
parent17ac290f4d460961dd5f1970a6bc83eea174efaa (diff)
downloaddokka-a128cdd43265134a2a2c6b45f5d55b3543a9c794.tar.gz
dokka-a128cdd43265134a2a2c6b45f5d55b3543a9c794.tar.bz2
dokka-a128cdd43265134a2a2c6b45f5d55b3543a9c794.zip
Fix unnecessary wrapping of signatures, changes in layout
Diffstat (limited to 'plugins/base/src/main/kotlin/translators/documentables/PageContentBuilder.kt')
-rw-r--r--plugins/base/src/main/kotlin/translators/documentables/PageContentBuilder.kt22
1 files changed, 9 insertions, 13 deletions
diff --git a/plugins/base/src/main/kotlin/translators/documentables/PageContentBuilder.kt b/plugins/base/src/main/kotlin/translators/documentables/PageContentBuilder.kt
index 74d0011f..d9a78d0d 100644
--- a/plugins/base/src/main/kotlin/translators/documentables/PageContentBuilder.kt
+++ b/plugins/base/src/main/kotlin/translators/documentables/PageContentBuilder.kt
@@ -39,7 +39,7 @@ open class PageContentBuilder(
): ContentGroup =
DocumentableContentBuilder(d.dri, platformData, styles, extra)
.apply(block)
- .build(d.platformData.toSet(), kind, styles, extra)
+ .build(platformData, kind, styles, extra)
@ContentBuilderMarker
open inner class DocumentableContentBuilder(
@@ -123,12 +123,12 @@ open class PageContentBuilder(
extra: PropertyContainer<ContentNode> = mainExtra,
operation: DocumentableContentBuilder.() -> List<ContentGroup>
) {
- contents += ContentTable(
- emptyList(),
- operation(),
- DCI(setOf(mainDRI), kind),
- platformData, styles, extra
- )
+ contents += ContentTable(
+ emptyList(),
+ operation(),
+ DCI(setOf(mainDRI), kind),
+ platformData, styles, extra
+ )
}
fun <T : Documentable> block(
@@ -148,7 +148,6 @@ open class PageContentBuilder(
emptyList(),
elements.map {
buildGroup(it.dri, it.platformData.toSet(), kind, styles, extra) {
- // TODO this will fail
operation(it)
}
},
@@ -244,10 +243,6 @@ open class PageContentBuilder(
block: DocumentableContentBuilder.() -> Unit
): ContentGroup = contentFor(dri, platformData, kind, styles, extra, block)
- fun breakLine(platformData: Set<PlatformData> = mainPlatformData) {
- contents += ContentBreakLine(platformData)
- }
-
fun platformDependentHint(
dri: DRI = mainDRI,
platformData: Set<PlatformData> = mainPlatformData,
@@ -273,8 +268,9 @@ open class PageContentBuilder(
fun <T> platformText(
value: PlatformDependent<T>,
+ platforms: Set<PlatformData> = value.keys,
transform: (T) -> String
- ) = value.entries.forEach { (p, v) ->
+ ) = value.entries.filter { it.key in platforms }.forEach { (p, v) ->
transform(v).takeIf { it.isNotBlank() }?.also { text(it, platformData = setOf(p)) }
}
}