aboutsummaryrefslogtreecommitdiff
path: root/plugins/base/src/main/kotlin
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/base/src/main/kotlin')
-rw-r--r--plugins/base/src/main/kotlin/translators/documentables/PageContentBuilder.kt27
1 files changed, 15 insertions, 12 deletions
diff --git a/plugins/base/src/main/kotlin/translators/documentables/PageContentBuilder.kt b/plugins/base/src/main/kotlin/translators/documentables/PageContentBuilder.kt
index 6d73bfdc..9d153a19 100644
--- a/plugins/base/src/main/kotlin/translators/documentables/PageContentBuilder.kt
+++ b/plugins/base/src/main/kotlin/translators/documentables/PageContentBuilder.kt
@@ -137,20 +137,23 @@ open class PageContentBuilder(
platformData: Set<PlatformData> = mainPlatformData,
styles: Set<Style> = mainStyles,
extras: Set<Extra> = mainExtras,
+ renderWhenEmpty: Boolean = false,
operation: DocumentableContentBuilder.(T) -> Unit
) {
- header(level) { text(name) }
- contents += ContentTable(
- emptyList(),
- elements.map {
- group(it.dri, it.platformData.toSet(), kind, styles, extras) {
- // TODO this will fail
- operation(it)
- }
- },
- DCI(setOf(mainDRI), kind),
- platformData, styles, extras
- )
+ if (renderWhenEmpty || elements.any()) {
+ header(level) { text(name) }
+ contents += ContentTable(
+ emptyList(),
+ elements.map {
+ group(it.dri, it.platformData.toSet(), kind, styles, extras) {
+ // TODO this will fail
+ operation(it)
+ }
+ },
+ DCI(setOf(mainDRI), kind),
+ platformData, styles, extras
+ )
+ }
}
fun <T> list(