diff options
author | Ignat Beresnev <ignat.beresnev@jetbrains.com> | 2023-08-31 20:16:01 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-08-31 20:16:01 +0200 |
commit | 02f30b142aa467d3a24cc52a1fe3f2fed7ea1e33 (patch) | |
tree | 66f6d6f089a93b863bf1144666491eca6729ad05 /plugins/base/src/main/kotlin/renderers/preprocessors.kt | |
parent | 6a181a7a2b03ec263788d137610e86937a57d434 (diff) | |
download | dokka-02f30b142aa467d3a24cc52a1fe3f2fed7ea1e33.tar.gz dokka-02f30b142aa467d3a24cc52a1fe3f2fed7ea1e33.tar.bz2 dokka-02f30b142aa467d3a24cc52a1fe3f2fed7ea1e33.zip |
Enable explicit API mode (#3139)
Diffstat (limited to 'plugins/base/src/main/kotlin/renderers/preprocessors.kt')
-rw-r--r-- | plugins/base/src/main/kotlin/renderers/preprocessors.kt | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/plugins/base/src/main/kotlin/renderers/preprocessors.kt b/plugins/base/src/main/kotlin/renderers/preprocessors.kt index c18748f4..a3a32651 100644 --- a/plugins/base/src/main/kotlin/renderers/preprocessors.kt +++ b/plugins/base/src/main/kotlin/renderers/preprocessors.kt @@ -9,19 +9,21 @@ import org.jetbrains.dokka.pages.* import org.jetbrains.dokka.plugability.DokkaContext import org.jetbrains.dokka.transformers.pages.PageTransformer -object RootCreator : PageTransformer { - override fun invoke(input: RootPageNode) = +public object RootCreator : PageTransformer { + override fun invoke(input: RootPageNode): RootPageNode = RendererSpecificRootPage("", listOf(input), RenderingStrategy.DoNothing) } -class PackageListCreator( - val context: DokkaContext, - val format: LinkFormat, - val outputFilesNames: List<String> = listOf("package-list") +public class PackageListCreator( + public val context: DokkaContext, + public val format: LinkFormat, + public val outputFilesNames: List<String> = listOf("package-list") ) : PageTransformer { - override fun invoke(input: RootPageNode) = input.transformPageNodeTree { pageNode -> + override fun invoke(input: RootPageNode): RootPageNode { + return input.transformPageNodeTree { pageNode -> pageNode.takeIf { it is ModulePage }?.let { it.modified(children = it.children + packageList(input, it as ModulePage)) } ?: pageNode } + } private fun packageList(rootPageNode: RootPageNode, module: ModulePage): List<RendererSpecificPage> { val content = PackageListService(context, rootPageNode).createPackageList( |