Skip to content

Commit

Permalink
Fix name of generated all-types page file
Browse files Browse the repository at this point in the history
  • Loading branch information
whyoleg committed Oct 30, 2023
1 parent 64342cf commit 76e66ac
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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<String> = setOf("index", "con", "aux", "lst", "prn", "nul", "eof", "inp", "out")
private const val ALL_TYPES_PAGE_PATH: String = "all-types"

public val reservedFilenames: Set<String> = 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('|', '>', '<', '*', ':', '"', '?', '%')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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())
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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",
)
}
}
Expand Down

0 comments on commit 76e66ac

Please sign in to comment.