diff options
author | Dmitry Jemerov <yole@jetbrains.com> | 2015-05-29 13:52:43 +0200 |
---|---|---|
committer | Dmitry Jemerov <yole@jetbrains.com> | 2015-05-29 13:52:43 +0200 |
commit | 64414ce984bc86e09b8724adbd01f1cb2646c17e (patch) | |
tree | 802710da5009b0b86519cc7cde9cdb6685cc7c99 /src/Locations | |
parent | 2fc80c4aae0d2957b34b176b9a2a48cb5089f41c (diff) | |
download | dokka-64414ce984bc86e09b8724adbd01f1cb2646c17e.tar.gz dokka-64414ce984bc86e09b8724adbd01f1cb2646c17e.tar.bz2 dokka-64414ce984bc86e09b8724adbd01f1cb2646c17e.zip |
apply code cleanup; fix couple of deprecations manually
Diffstat (limited to 'src/Locations')
-rw-r--r-- | src/Locations/LocationService.kt | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/Locations/LocationService.kt b/src/Locations/LocationService.kt index 2c93ba8f..7d0b8b56 100644 --- a/src/Locations/LocationService.kt +++ b/src/Locations/LocationService.kt @@ -2,7 +2,7 @@ package org.jetbrains.dokka import java.io.File -public trait Location { +public interface Location { val path: String get fun relativePathTo(other: Location, anchor: String? = null): String } @@ -41,7 +41,7 @@ public data class FileLocation(val file: File): Location { * * [SingleFolderLocationService] – all documentation is generated into single folder using fully qualified names * for file names. */ -public trait LocationService { +public interface LocationService { fun withExtension(newExtension: String) = this fun location(node: DocumentationNode): Location = location(node.path.map { it.name }, node.members.any()) @@ -54,7 +54,7 @@ public trait LocationService { } -public trait FileLocationService: LocationService { +public interface FileLocationService: LocationService { override fun location(node: DocumentationNode): FileLocation = location(node.path.map { it.name }, node.members.any()) override fun location(qualifiedName: List<String>, hasMembers: Boolean): FileLocation } @@ -62,7 +62,7 @@ public trait FileLocationService: LocationService { public fun identifierToFilename(path: String): String { val escaped = path.replace('<', '-').replace('>', '-') - val lowercase = escaped.replaceAll("[A-Z]") { matchResult -> "-" + matchResult.group().toLowerCase() } + val lowercase = escaped.replace("[A-Z]".toRegex()) { matchResult -> "-" + matchResult.value.toLowerCase() } return if (lowercase == "index") "--index--" else lowercase } |