aboutsummaryrefslogtreecommitdiff
path: root/src/Locations/SingleFolderLocationService.kt
diff options
context:
space:
mode:
Diffstat (limited to 'src/Locations/SingleFolderLocationService.kt')
-rw-r--r--src/Locations/SingleFolderLocationService.kt9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/Locations/SingleFolderLocationService.kt b/src/Locations/SingleFolderLocationService.kt
index aefab450..e136a6b2 100644
--- a/src/Locations/SingleFolderLocationService.kt
+++ b/src/Locations/SingleFolderLocationService.kt
@@ -2,10 +2,13 @@ package org.jetbrains.dokka
import java.io.File
-public fun SingleFolderLocationService(root: String): SingleFolderLocationService = SingleFolderLocationService(File(root))
-public class SingleFolderLocationService(val root: File) : FileLocationService {
+public fun SingleFolderLocationService(root: String): SingleFolderLocationService = SingleFolderLocationService(File(root), "")
+public class SingleFolderLocationService(val root: File, val extension: String) : FileLocationService {
+ override fun withExtension(newExtension: String): LocationService =
+ SingleFolderLocationService(root, newExtension)
+
override fun location(node: DocumentationNode): FileLocation {
val filename = node.path.map { identifierToFilename(it.name) }.joinToString("-")
- return FileLocation(File(root, filename))
+ return FileLocation(File(root, filename).appendExtension(extension))
}
} \ No newline at end of file