diff options
author | Dmitry Jemerov <yole@jetbrains.com> | 2015-02-20 14:44:30 +0100 |
---|---|---|
committer | Dmitry Jemerov <yole@jetbrains.com> | 2015-02-20 14:44:30 +0100 |
commit | ecadf405143811776f46142e7c97cc33380efb68 (patch) | |
tree | c03992fcd662e333cdc360a44a6e5d3b9ebb6120 /src/Locations/FoldersLocationService.kt | |
parent | 85a3ae7626810113816fd31a0e26d44d48308ed2 (diff) | |
download | dokka-ecadf405143811776f46142e7c97cc33380efb68.tar.gz dokka-ecadf405143811776f46142e7c97cc33380efb68.tar.bz2 dokka-ecadf405143811776f46142e7c97cc33380efb68.zip |
allow a LocationService to take a qualified name directly, not just a DocumentationNode
Diffstat (limited to 'src/Locations/FoldersLocationService.kt')
-rw-r--r-- | src/Locations/FoldersLocationService.kt | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/Locations/FoldersLocationService.kt b/src/Locations/FoldersLocationService.kt index 4f56475c..ce202cfe 100644 --- a/src/Locations/FoldersLocationService.kt +++ b/src/Locations/FoldersLocationService.kt @@ -6,14 +6,14 @@ public fun FoldersLocationService(root: String): FoldersLocationService = Folder public class FoldersLocationService(val root: File, val extension: String) : FileLocationService { override fun withExtension(newExtension: String): LocationService = FoldersLocationService(root, newExtension) - override fun location(node: DocumentationNode): FileLocation { - return FileLocation(File(root, relativePathToNode(node)).appendExtension(extension)) + override fun location(qualifiedName: List<String>, hasMembers: Boolean): FileLocation { + return FileLocation(File(root, relativePathToNode(qualifiedName, hasMembers)).appendExtension(extension)) } } -fun relativePathToNode(node: DocumentationNode): String { - val parts = node.path.map { identifierToFilename(it.name) }.filterNot { it.isEmpty() } - return if (node.members.none()) { +fun relativePathToNode(qualifiedName: List<String>, hasMembers: Boolean): String { + val parts = qualifiedName.map { identifierToFilename(it) }.filterNot { it.isEmpty() } + return if (!hasMembers) { // leaf node, use file in owner's folder parts.joinToString("/") } else { |