From 69d16856abcc68b31d298e6a62a7a58106de69c9 Mon Sep 17 00:00:00 2001 From: Marcin Aman Date: Thu, 20 Aug 2020 16:19:42 +0200 Subject: Include interfaces to abstract model --- plugins/base/src/main/kotlin/renderers/PackageListService.kt | 2 +- plugins/base/src/main/kotlin/renderers/preprocessors.kt | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'plugins/base/src/main') diff --git a/plugins/base/src/main/kotlin/renderers/PackageListService.kt b/plugins/base/src/main/kotlin/renderers/PackageListService.kt index 44769d9e..3d631f5c 100644 --- a/plugins/base/src/main/kotlin/renderers/PackageListService.kt +++ b/plugins/base/src/main/kotlin/renderers/PackageListService.kt @@ -21,7 +21,7 @@ class PackageListService(val context: DokkaContext) { fun visit(node: PageNode, parentDris: Set) { - if (node is PackagePageNode) { + if (node is PackagePage) { node.name .takeUnless { name -> name.startsWith("[") && name.endsWith("]") } // Do not include the package name for declarations without one ?.let { packages.add(it) } diff --git a/plugins/base/src/main/kotlin/renderers/preprocessors.kt b/plugins/base/src/main/kotlin/renderers/preprocessors.kt index b07db2bd..42d0d3c4 100644 --- a/plugins/base/src/main/kotlin/renderers/preprocessors.kt +++ b/plugins/base/src/main/kotlin/renderers/preprocessors.kt @@ -11,17 +11,17 @@ object RootCreator : PageTransformer { } -class PackageListCreator(val context: DokkaContext, val format: LinkFormat) : PageTransformer { +class PackageListCreator(val context: DokkaContext, val format: LinkFormat, val fileName: String = "package-list") : PageTransformer { override fun invoke(input: RootPageNode) = input.modified(children = input.children.map { - it.takeUnless { it is ModulePageNode } + it.takeUnless { it is ModulePage } ?: it.modified(children = it.children + packageList(input)) // TODO packageList should take module as an input }) private fun packageList(pageNode: RootPageNode) = RendererSpecificResourcePage( - "${pageNode.name}/package-list", + "${pageNode.name}/${fileName}", emptyList(), RenderingStrategy.Write(PackageListService(context).formatPackageList(pageNode, format.formatName, format.linkExtension)) ) -- cgit