From 0bf1d0f5491a62c56393a06cdfb4168778d9829e Mon Sep 17 00:00:00 2001 From: Kamil Doległo <9080183+kamildoleglo@users.noreply.github.com> Date: Mon, 5 Jul 2021 14:10:23 +0200 Subject: Flatten multi-module structure (#1980) * Add support for multimodule package lists * Merge package-lists in multi-module generation * Remove double-wrapping of modules in multi-module generation * Handle empty modules in package lists --- .../base/src/main/kotlin/renderers/html/htmlPreprocessors.kt | 10 +++++----- 1 file changed, 5 insertions(+), 5 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 92f7324c..ff724f02 100644 --- a/plugins/base/src/main/kotlin/renderers/html/htmlPreprocessors.kt +++ b/plugins/base/src/main/kotlin/renderers/html/htmlPreprocessors.kt @@ -15,8 +15,8 @@ import org.jetbrains.dokka.plugability.configuration import org.jetbrains.dokka.transformers.pages.PageTransformer abstract class NavigationDataProvider { - open fun navigableChildren(input: RootPageNode): NavigationNode = - input.children.filterIsInstance().single().let { visit(it) } + open fun navigableChildren(input: RootPageNode): NavigationNode = input.withDescendants() + .first { it is ModulePage || it is MultimoduleRootPage }.let { visit(it as ContentPage) } open fun visit(page: ContentPage): NavigationNode = NavigationNode( @@ -167,9 +167,9 @@ private fun List.toRenderSpecificResourcePage(): List key.toString() to values.map { it.toString() } }.toMap() @@ -191,4 +191,4 @@ class SourcesetDependencyAppender(val context: DokkaContext) : PageTransformer { children = input.children + deps ).transformContentPagesTree { it.modified(embeddedResources = it.embeddedResources + name) } } -} \ No newline at end of file +} -- cgit