From 1634c8a0184749ae9314adecf409851c35e93775 Mon Sep 17 00:00:00 2001 From: Marcin Aman Date: Thu, 20 Aug 2020 17:44:22 +0200 Subject: Make NavigationNode implement WithChildren --- plugins/base/src/main/kotlin/renderers/html/htmlPreprocessors.kt | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'plugins/base/src/main/kotlin/renderers/html/htmlPreprocessors.kt') diff --git a/plugins/base/src/main/kotlin/renderers/html/htmlPreprocessors.kt b/plugins/base/src/main/kotlin/renderers/html/htmlPreprocessors.kt index 6e779931..f4c9a1f7 100644 --- a/plugins/base/src/main/kotlin/renderers/html/htmlPreprocessors.kt +++ b/plugins/base/src/main/kotlin/renderers/html/htmlPreprocessors.kt @@ -11,6 +11,7 @@ import org.jetbrains.dokka.base.renderers.sourceSets import org.jetbrains.dokka.links.DRI import org.jetbrains.dokka.model.DEnum import org.jetbrains.dokka.model.DEnumEntry +import org.jetbrains.dokka.model.withDescendants import org.jetbrains.dokka.pages.* import org.jetbrains.dokka.plugability.DokkaContext import org.jetbrains.dokka.transformers.pages.PageTransformer @@ -61,9 +62,7 @@ object NavigationPageInstaller : PageTransformer { name = "scripts/navigation-pane.json", children = emptyList(), strategy = RenderingStrategy.LocationResolvableWrite { resolver -> - val flattened = flattenNavigationNodes(listOf(nodes)) - val view = flattened.map { NavigationNodeView.from(it, resolver(it.dri, it.sourceSets)) } - mapper.writeValueAsString(view) + mapper.writeValueAsString(nodes.withDescendants().map { NavigationNodeView.from(it, resolver(it.dri, it.sourceSets)) }) }) return input.modified( -- cgit