aboutsummaryrefslogtreecommitdiff
path: root/plugins/base/src/main/kotlin/resolvers/external/DefaultExternalLocationProvider.kt
diff options
context:
space:
mode:
authorKamil Doległo <9080183+kamildoleglo@users.noreply.github.com>2021-07-05 14:10:23 +0200
committerGitHub <noreply@github.com>2021-07-05 14:10:23 +0200
commit0bf1d0f5491a62c56393a06cdfb4168778d9829e (patch)
tree808f631e72b652dc2c3d5929f85f677968bc56f6 /plugins/base/src/main/kotlin/resolvers/external/DefaultExternalLocationProvider.kt
parenta1d44ab80df217196fe5ee9455c7cf1c135e3b07 (diff)
downloaddokka-0bf1d0f5491a62c56393a06cdfb4168778d9829e.tar.gz
dokka-0bf1d0f5491a62c56393a06cdfb4168778d9829e.tar.bz2
dokka-0bf1d0f5491a62c56393a06cdfb4168778d9829e.zip
Flatten multi-module structure (#1980)
* Add support for multimodule package lists * Merge package-lists in multi-module generation * Remove double-wrapping of modules in multi-module generation * Handle empty modules in package lists
Diffstat (limited to 'plugins/base/src/main/kotlin/resolvers/external/DefaultExternalLocationProvider.kt')
-rw-r--r--plugins/base/src/main/kotlin/resolvers/external/DefaultExternalLocationProvider.kt14
1 files changed, 12 insertions, 2 deletions
diff --git a/plugins/base/src/main/kotlin/resolvers/external/DefaultExternalLocationProvider.kt b/plugins/base/src/main/kotlin/resolvers/external/DefaultExternalLocationProvider.kt
index 09eb7cc4..fc7f57f4 100644
--- a/plugins/base/src/main/kotlin/resolvers/external/DefaultExternalLocationProvider.kt
+++ b/plugins/base/src/main/kotlin/resolvers/external/DefaultExternalLocationProvider.kt
@@ -22,11 +22,21 @@ open class DefaultExternalLocationProvider(
}
protected open fun DRI.constructPath(): String {
- val classNamesChecked = classNames ?: return "$docURL${packageName ?: ""}/index$extension"
+ val modulePart = packageName?.let { packageName ->
+ externalDocumentation.packageList.moduleFor(packageName)?.let {
+ if (it.isNotBlank())
+ "$it/"
+ else
+ ""
+ }
+ }.orEmpty()
+
+ val docWithModule = docURL + modulePart
+ val classNamesChecked = classNames ?: return "$docWithModule${packageName ?: ""}/index$extension"
val classLink = (listOfNotNull(packageName) + classNamesChecked.split('.'))
.joinToString("/", transform = ::identifierToFilename)
val fileName = callable?.let { identifierToFilename(it.name) } ?: "index"
- return "$docURL$classLink/$fileName$extension"
+ return "$docWithModule$classLink/$fileName$extension"
}
}