aboutsummaryrefslogtreecommitdiff
path: root/plugins/base/src/main/kotlin
diff options
context:
space:
mode:
authorMarcin Aman <maman@virtuslab.com>2020-08-20 16:19:42 +0200
committerPaweł Marks <Kordyjan@users.noreply.github.com>2020-08-20 16:56:21 +0200
commit69d16856abcc68b31d298e6a62a7a58106de69c9 (patch)
treed2ec056c46382f0e1807ab4b410431c4fde957ec /plugins/base/src/main/kotlin
parent3af779ff3377901d946a230f9900f5a508bf08e3 (diff)
downloaddokka-69d16856abcc68b31d298e6a62a7a58106de69c9.tar.gz
dokka-69d16856abcc68b31d298e6a62a7a58106de69c9.tar.bz2
dokka-69d16856abcc68b31d298e6a62a7a58106de69c9.zip
Include interfaces to abstract model
Diffstat (limited to 'plugins/base/src/main/kotlin')
-rw-r--r--plugins/base/src/main/kotlin/renderers/PackageListService.kt2
-rw-r--r--plugins/base/src/main/kotlin/renderers/preprocessors.kt6
2 files changed, 4 insertions, 4 deletions
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<DRI>) {
- 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))
)