From 76e66ac136249d3bf7639af65c5388993ee3c502 Mon Sep 17 00:00:00 2001 From: Oleg Yukhnevich Date: Mon, 30 Oct 2023 18:06:53 +0200 Subject: [PATCH] Fix name of generated all-types page file --- .../kotlin/resolvers/local/DokkaLocationProvider.kt | 10 +++++++++- .../test/kotlin/content/annotations/SinceKotlinTest.kt | 2 +- .../src/test/kotlin/renderers/html/NavigationTest.kt | 2 +- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/plugins/base/src/main/kotlin/resolvers/local/DokkaLocationProvider.kt b/plugins/base/src/main/kotlin/resolvers/local/DokkaLocationProvider.kt index aedbfb88eed..f2967e89c55 100644 --- a/plugins/base/src/main/kotlin/resolvers/local/DokkaLocationProvider.kt +++ b/plugins/base/src/main/kotlin/resolvers/local/DokkaLocationProvider.kt @@ -25,6 +25,9 @@ public open class DokkaLocationProvider( if (page is RootPageNode && page.forceTopLevelName) { put(page, prefix + PAGE_WITH_CHILDREN_SUFFIX) page.children.forEach { registerPath(it, prefix) } + } else if (page is AllTypesPageNode) { + put(page, prefix + ALL_TYPES_PAGE_PATH) + page.children.forEach { registerPath(it, prefix) } } else { val newPrefix = prefix + page.pathName put(page, if (page is ModulePageNode) prefix else newPrefix) @@ -159,7 +162,12 @@ public open class DokkaLocationProvider( protected data class PageWithKind(val page: ContentPage, val kind: Kind) public companion object { - public val reservedFilenames: Set = setOf("index", "con", "aux", "lst", "prn", "nul", "eof", "inp", "out") + private const val ALL_TYPES_PAGE_PATH: String = "all-types" + + public val reservedFilenames: Set = setOf( + "index", "con", "aux", "lst", "prn", "nul", "eof", "inp", "out", + ALL_TYPES_PAGE_PATH + ) //Taken from: https://stackoverflow.com/questions/1976007/what-characters-are-forbidden-in-windows-and-linux-directory-names internal val reservedCharacters = setOf('|', '>', '<', '*', ':', '"', '?', '%') diff --git a/plugins/base/src/test/kotlin/content/annotations/SinceKotlinTest.kt b/plugins/base/src/test/kotlin/content/annotations/SinceKotlinTest.kt index fd04ef352d1..167aba90131 100644 --- a/plugins/base/src/test/kotlin/content/annotations/SinceKotlinTest.kt +++ b/plugins/base/src/test/kotlin/content/annotations/SinceKotlinTest.kt @@ -84,7 +84,7 @@ class SinceKotlinTest : AbstractRenderingTest() { assertEquals(5, content.getElementsContainingOwnText("Since Kotlin").count()) // 2 = 1 typealias, 1 class - val allTypesContent = writerPlugin.renderedContent("root/-all -types.html") + val allTypesContent = writerPlugin.renderedContent("root/all-types.html") assertEquals(2, allTypesContent.getElementsContainingOwnText("Since Kotlin").count()) } } diff --git a/plugins/base/src/test/kotlin/renderers/html/NavigationTest.kt b/plugins/base/src/test/kotlin/renderers/html/NavigationTest.kt index ceeea40ec60..5aae657e802 100644 --- a/plugins/base/src/test/kotlin/renderers/html/NavigationTest.kt +++ b/plugins/base/src/test/kotlin/renderers/html/NavigationTest.kt @@ -99,7 +99,7 @@ class NavigationTest : BaseAbstractTest() { content[6].assertNavigationLink( id = "root-nav-submenu-1", text = "All Types", - address = "root/-all -types.html", + address = "root/all-types.html", ) } }