diff options
author | Paweł Marks <pmarks@virtuslab.com> | 2020-02-27 14:47:19 +0100 |
---|---|---|
committer | Paweł Marks <pmarks@virtuslab.com> | 2020-02-27 14:48:06 +0100 |
commit | 77d6ce22a286601bc5d1401619eb42fac58e7013 (patch) | |
tree | 2501a9bdca87833393c397b8ec69be924279c267 /plugins/base/src/main | |
parent | 4705e788a52287b2eb1275253bad41f178d42df2 (diff) | |
download | dokka-77d6ce22a286601bc5d1401619eb42fac58e7013.tar.gz dokka-77d6ce22a286601bc5d1401619eb42fac58e7013.tar.bz2 dokka-77d6ce22a286601bc5d1401619eb42fac58e7013.zip |
Skipping empty block by default
Diffstat (limited to 'plugins/base/src/main')
-rw-r--r-- | plugins/base/src/main/kotlin/translators/documentables/PageContentBuilder.kt | 27 |
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( |