diff options
author | Kamil Doległo <9080183+kamildoleglo@users.noreply.github.com> | 2021-07-05 14:10:23 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-07-05 14:10:23 +0200 |
commit | 0bf1d0f5491a62c56393a06cdfb4168778d9829e (patch) | |
tree | 808f631e72b652dc2c3d5929f85f677968bc56f6 /plugins/base/src/main/kotlin/renderers/html/htmlPreprocessors.kt | |
parent | a1d44ab80df217196fe5ee9455c7cf1c135e3b07 (diff) | |
download | dokka-0bf1d0f5491a62c56393a06cdfb4168778d9829e.tar.gz dokka-0bf1d0f5491a62c56393a06cdfb4168778d9829e.tar.bz2 dokka-0bf1d0f5491a62c56393a06cdfb4168778d9829e.zip |
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
Diffstat (limited to 'plugins/base/src/main/kotlin/renderers/html/htmlPreprocessors.kt')
-rw-r--r-- | plugins/base/src/main/kotlin/renderers/html/htmlPreprocessors.kt | 10 |
1 files changed, 5 insertions, 5 deletions
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<ContentPage>().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<String>.toRenderSpecificResourcePage(): List<RendererSpecificRe class SourcesetDependencyAppender(val context: DokkaContext) : PageTransformer { private val name = "scripts/sourceset_dependencies.js" override fun invoke(input: RootPageNode): RootPageNode { - val dependenciesMap = context.configuration.sourceSets.map { + val dependenciesMap = context.configuration.sourceSets.associate { it.sourceSetID to it.dependentSourceSets - }.toMap() + } fun createDependenciesJson(): String = dependenciesMap.map { (key, values) -> 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 +} |