diff options
author | Kamil Doległo <kamilok1965@interia.pl> | 2020-04-06 22:24:30 +0200 |
---|---|---|
committer | Paweł Marks <Kordyjan@users.noreply.github.com> | 2020-04-08 17:02:01 +0200 |
commit | a128cdd43265134a2a2c6b45f5d55b3543a9c794 (patch) | |
tree | b5ad1118fcef7337f49054e5c92d3114e5af7019 /plugins/base/src/main/kotlin/renderers | |
parent | 17ac290f4d460961dd5f1970a6bc83eea174efaa (diff) | |
download | dokka-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/renderers')
-rw-r--r-- | plugins/base/src/main/kotlin/renderers/html/HtmlRenderer.kt | 26 |
1 files changed, 16 insertions, 10 deletions
diff --git a/plugins/base/src/main/kotlin/renderers/html/HtmlRenderer.kt b/plugins/base/src/main/kotlin/renderers/html/HtmlRenderer.kt index 1365fecb..e1025ed4 100644 --- a/plugins/base/src/main/kotlin/renderers/html/HtmlRenderer.kt +++ b/plugins/base/src/main/kotlin/renderers/html/HtmlRenderer.kt @@ -29,9 +29,13 @@ open class HtmlRenderer( ) { val additionalClasses = node.style.joinToString(" ") { it.toString().toLowerCase() } return when { - ContentKind.shouldBePlatformTagged(node.dci.kind) -> wrapPlatformTagged(node, pageContext) { childrenCallback() } + ContentKind.shouldBePlatformTagged(node.dci.kind) -> wrapPlatformTagged( + node, + pageContext + ) { childrenCallback() } node.dci.kind == ContentKind.Symbol -> div("symbol $additionalClasses") { childrenCallback() } node.dci.kind == ContentKind.BriefComment -> div("brief $additionalClasses") { childrenCallback() } + node.dci.kind == ContentKind.Cover -> div("cover $additionalClasses") { childrenCallback() } node.style.contains(TextStyle.Paragraph) -> p(additionalClasses) { childrenCallback() } node.style.contains(TextStyle.Block) -> div(additionalClasses) { childrenCallback() } else -> childrenCallback() @@ -43,13 +47,13 @@ open class HtmlRenderer( pageContext: ContentPage, childrenCallback: FlowContent.() -> Unit ) { - div("platform-tagged"){ + div("platform-tagged") { node.platforms.forEach { - div("platform-tag ${it.platformType.name}"){ + div("platform-tag ${it.platformType.name}") { text(it.platformType.key.toUpperCase()) } } - div("content"){ + div("content") { childrenCallback() } } @@ -176,7 +180,7 @@ open class HtmlRenderer( } } tbody { - if(ContentKind.shouldBePlatformTagged(node.dci.kind)) { + if (ContentKind.shouldBePlatformTagged(node.dci.kind)) { buildPlatformTaggedRow(node, pageContext, platformRestriction) } else { buildRow(node, pageContext, platformRestriction) @@ -198,10 +202,12 @@ open class HtmlRenderer( } override fun FlowContent.buildNavigation(page: PageNode) = - locationProvider.ancestors(page).asReversed().forEach { node -> - text("/") - if (node.isNavigable) buildLink(node, page) - else text(node.name) + div(classes = "breadcrumbs") { + locationProvider.ancestors(page).asReversed().forEach { node -> + text("/") + if (node.isNavigable) buildLink(node, page) + else text(node.name) + } } private fun FlowContent.buildLink(to: PageNode, from: PageNode) = @@ -257,7 +263,7 @@ open class HtmlRenderer( } override fun FlowContent.buildText(textNode: ContentText) { - when{ + when { textNode.style.contains(TextStyle.Indented) -> consumer.onTagContentEntity(Entities.nbsp) } text(textNode.text) |