aboutsummaryrefslogtreecommitdiff
path: root/plugins/base/src/main/kotlin/renderers/html/NavigationPage.kt
diff options
context:
space:
mode:
authorIgnat Beresnev <ignat.beresnev@jetbrains.com>2022-08-18 19:33:53 +0200
committerGitHub <noreply@github.com>2022-08-18 19:33:53 +0200
commit50a3323322265ff3b5dab1d861a25bbb1167812a (patch)
tree0966cfab6d9155724a65439a5c0d1476d66b0a7a /plugins/base/src/main/kotlin/renderers/html/NavigationPage.kt
parentdf8d9879b818799c83ff731b3a78e7d2b96fd8e5 (diff)
downloaddokka-50a3323322265ff3b5dab1d861a25bbb1167812a.tar.gz
dokka-50a3323322265ff3b5dab1d861a25bbb1167812a.tar.bz2
dokka-50a3323322265ff3b5dab1d861a25bbb1167812a.zip
Add deprecation details block (#2622)
Diffstat (limited to 'plugins/base/src/main/kotlin/renderers/html/NavigationPage.kt')
-rw-r--r--plugins/base/src/main/kotlin/renderers/html/NavigationPage.kt17
1 files changed, 14 insertions, 3 deletions
diff --git a/plugins/base/src/main/kotlin/renderers/html/NavigationPage.kt b/plugins/base/src/main/kotlin/renderers/html/NavigationPage.kt
index 87808add..fc17983d 100644
--- a/plugins/base/src/main/kotlin/renderers/html/NavigationPage.kt
+++ b/plugins/base/src/main/kotlin/renderers/html/NavigationPage.kt
@@ -57,17 +57,27 @@ class NavigationPage(
span("nav-link-grid") {
span("nav-link-child ${node.icon?.style()}")
span("nav-link-child") {
- buildBreakableText(node.name)
+ nodeText(node)
}
}
} else {
- buildBreakableText(node.name)
+ nodeText(node)
}
}
}
node.children.withIndex().forEach { (n, p) -> visit(p, "$navId-$n", renderer) }
}
}
+
+ private fun FlowContent.nodeText(node: NavigationNode) {
+ if (node.styles.contains(TextStyle.Strikethrough)) {
+ strike {
+ buildBreakableText(node.name)
+ }
+ } else {
+ buildBreakableText(node.name)
+ }
+ }
}
data class NavigationNode(
@@ -75,6 +85,7 @@ data class NavigationNode(
val dri: DRI,
val sourceSets: Set<DisplaySourceSet>,
val icon: NavigationNodeIcon?,
+ val styles: Set<Style> = emptySet(),
override val children: List<NavigationNode>
) : WithChildren<NavigationNode>
@@ -108,4 +119,4 @@ fun NavigationPage.transform(block: (NavigationNode) -> NavigationNode) =
NavigationPage(root.transform(block), moduleName, context)
fun NavigationNode.transform(block: (NavigationNode) -> NavigationNode) =
- run(block).let { NavigationNode(it.name, it.dri, it.sourceSets, it.icon, it.children.map(block)) }
+ run(block).let { NavigationNode(it.name, it.dri, it.sourceSets, it.icon, it.styles, it.children.map(block)) }