diff options
author | Filip Zybała <fzybala@virtuslab.com> | 2020-03-27 09:57:30 +0100 |
---|---|---|
committer | Paweł Marks <Kordyjan@users.noreply.github.com> | 2020-03-31 14:45:37 +0200 |
commit | a8e5b94f8e95138dbfa913b74a4d2d65fd5993c1 (patch) | |
tree | 299f36c80b06dcb1059a6b18cba0f4a51f673335 /plugins/base/src/main/kotlin | |
parent | c29d660242027eb23ff9c5d7c176eb188abcef74 (diff) | |
download | dokka-a8e5b94f8e95138dbfa913b74a4d2d65fd5993c1.tar.gz dokka-a8e5b94f8e95138dbfa913b74a4d2d65fd5993c1.tar.bz2 dokka-a8e5b94f8e95138dbfa913b74a4d2d65fd5993c1.zip |
Adjusted CSS, added animation. Adjusted table rendering to make it more aesthetic.
Generated new expect test outputs.
Diffstat (limited to 'plugins/base/src/main/kotlin')
-rw-r--r-- | plugins/base/src/main/kotlin/renderers/html/HtmlRenderer.kt | 48 | ||||
-rw-r--r-- | plugins/base/src/main/kotlin/translators/documentables/DefaultPageCreator.kt | 36 |
2 files changed, 55 insertions, 29 deletions
diff --git a/plugins/base/src/main/kotlin/renderers/html/HtmlRenderer.kt b/plugins/base/src/main/kotlin/renderers/html/HtmlRenderer.kt index 439a8fbe..19b0f26f 100644 --- a/plugins/base/src/main/kotlin/renderers/html/HtmlRenderer.kt +++ b/plugins/base/src/main/kotlin/renderers/html/HtmlRenderer.kt @@ -115,13 +115,20 @@ open class HtmlRenderer( } } - private fun TR.buildPlatformTags( - node: ContentGroup + private fun TBODY.buildPlatformTaggedRow( + node: ContentTable, + pageContext: ContentPage, + platformRestriction: PlatformData? ) { - if(ContentKind.shouldBePlatformTagged(node.dci.kind)) { - td { - div("platform-tagged"){ - node.platforms.forEach { + node.children.forEach { + tr("platform-tagged") { + it.children.forEach { + td("content") { + it.build(this, pageContext, platformRestriction) + } + } + td("platform-tagged") { + it.platforms.forEach { div(("platform-tag ${it.platformType.key}")) { text(it.platformType.key.toUpperCase()) } @@ -131,6 +138,22 @@ open class HtmlRenderer( } } + private fun TBODY.buildRow( + node: ContentTable, + pageContext: ContentPage, + platformRestriction: PlatformData? + ) { + node.children.forEach { + tr { + it.children.forEach { + td { + it.build(this, pageContext, platformRestriction) + } + } + } + } + } + override fun FlowContent.buildTable( node: ContentTable, pageContext: ContentPage, @@ -149,15 +172,10 @@ open class HtmlRenderer( } } tbody { - node.children.forEach { - tr { - it.children.forEach { - td { - it.build(this, pageContext, platformRestriction) - } - } - buildPlatformTags(it) - } + if(ContentKind.shouldBePlatformTagged(node.dci.kind)) { + buildPlatformTaggedRow(node, pageContext, platformRestriction) + } else { + buildRow(node, pageContext, platformRestriction) } } } diff --git a/plugins/base/src/main/kotlin/translators/documentables/DefaultPageCreator.kt b/plugins/base/src/main/kotlin/translators/documentables/DefaultPageCreator.kt index 349d9970..41d4b917 100644 --- a/plugins/base/src/main/kotlin/translators/documentables/DefaultPageCreator.kt +++ b/plugins/base/src/main/kotlin/translators/documentables/DefaultPageCreator.kt @@ -98,12 +98,14 @@ open class DefaultPageCreator( } block("Properties", 2, ContentKind.Properties, s.properties, platformData.toSet()) { link(it.name, it.dri) - platformDependentHint(it.dri, it.platformData.toSet()) { - +buildSignature(it) - } - breakLine() - group(kind = ContentKind.BriefComment) { - text(it.briefDocumentation()) + group { + platformDependentHint(it.dri, it.platformData.toSet()) { + +buildSignature(it) + } + breakLine() + group(kind = ContentKind.BriefComment) { + text(it.briefDocumentation()) + } } } (s as? WithExtraProperties<Documentable>)?.let { it.extra[InheritorsInfo] }?.let { inheritors -> @@ -144,20 +146,26 @@ open class DefaultPageCreator( c.platformData.toSet() ) { link(it.name, it.dri) - platformDependentHint(it.dri, it.platformData.toSet()) { - +buildSignature(it) - } - group(kind = ContentKind.BriefComment) { - text(it.briefDocumentation()) + group { + platformDependentHint(it.dri, it.platformData.toSet()) { + +buildSignature(it) + } + group(kind = ContentKind.BriefComment) { + text(it.briefDocumentation()) + } } } } if (c is DEnum) { block("Entries", 2, ContentKind.Classlikes, c.entries, c.platformData.toSet()) { link(it.name.orEmpty(), it.dri) - +buildSignature(it) - group(kind = ContentKind.BriefComment) { - text(it.briefDocumentation()) + group { + platformDependentHint(it.dri, it.platformData.toSet()){ + +buildSignature(it) + } + group(kind = ContentKind.BriefComment) { + text(it.briefDocumentation()) + } } } } |