diff options
Diffstat (limited to 'plugins/base/src/main')
5 files changed, 24 insertions, 30 deletions
diff --git a/plugins/base/src/main/kotlin/renderers/html/HtmlRenderer.kt b/plugins/base/src/main/kotlin/renderers/html/HtmlRenderer.kt index 42273d20..528b7d16 100644 --- a/plugins/base/src/main/kotlin/renderers/html/HtmlRenderer.kt +++ b/plugins/base/src/main/kotlin/renderers/html/HtmlRenderer.kt @@ -22,7 +22,7 @@ open class HtmlRenderer( private val sourceSetDependencyMap = with(context.sourceSetCache) { allSourceSets.map { sourceSet -> - sourceSet to allSourceSets.filter { sourceSet.dependentSourceSets.contains(it.sourceSetName) } + sourceSet to allSourceSets.filter { sourceSet.dependentSourceSets.contains(it.sourceSetID ) } }.toMap() } @@ -93,14 +93,14 @@ open class HtmlRenderer( group.sourceSets.forEach { button(classes = "platform-tag platform-selector") { attributes["data-active"] = "" - attributes["data-filter"] = it.sourceSetName - when (it.platform.key) { + attributes["data-filter"] = it.sourceSetID + when(it.platform.key) { "common" -> classes = classes + "common-like" "native" -> classes = classes + "native-like" "jvm" -> classes = classes + "jvm-like" "js" -> classes = classes + "js-like" } - text(it.sourceSetName) + text(it.displayName) } } } @@ -161,10 +161,10 @@ open class HtmlRenderer( attributes["data-toggle-list"] = "data-toggle-list" contents.forEachIndexed { index, pair -> button(classes = "platform-bookmark") { - attributes["data-filterable-current"] = pair.first.sourceSetName - attributes["data-filterable-set"] = pair.first.sourceSetName + attributes["data-filterable-current"] = pair.first.sourceSetID + attributes["data-filterable-set"] = pair.first.sourceSetID if (index == 0) attributes["data-active"] = "" - attributes["data-toggle"] = pair.first.sourceSetName + attributes["data-toggle"] = pair.first.sourceSetID when ( pair.first.platform.key ) { @@ -173,8 +173,8 @@ open class HtmlRenderer( "jvm" -> classes = classes + "jvm-like" "js" -> classes = classes + "js-like" } - attributes["data-toggle"] = pair.first.sourceSetName - text(pair.first.sourceSetName) + attributes["data-toggle"] = pair.first.sourceSetID + text(pair.first.displayName) } } } @@ -242,10 +242,10 @@ open class HtmlRenderer( consumer.onTagContentUnsafe { +createHTML().div("divergent-group") { attributes["data-filterable-current"] = groupedDivergent.keys.joinToString(" ") { - it.sourceSetName + it.sourceSetID } attributes["data-filterable-set"] = groupedDivergent.keys.joinToString(" ") { - it.sourceSetName + it.sourceSetID } val divergentForPlatformDependent = groupedDivergent.map { (sourceSet, elements) -> @@ -346,12 +346,13 @@ open class HtmlRenderer( div(classes = "table-row") { if (!style.contains(MultimoduleTable)) { attributes["data-filterable-current"] = node.sourceSets.joinToString(" ") { - it.sourceSetName + it.sourceSetID } attributes["data-filterable-set"] = node.sourceSets.joinToString(" ") { - it.sourceSetName + it.sourceSetID } } + it.filterIsInstance<ContentLink>().takeIf { it.isNotEmpty() }?.let { div("main-subrow " + node.style.joinToString(" ")) { it.filter { sourceSetRestriction == null || it.sourceSets.any { s -> s in sourceSetRestriction } } @@ -396,7 +397,7 @@ open class HtmlRenderer( "jvm" -> classes = classes + "jvm-like" "js" -> classes = classes + "js-like" } - text(it.sourceSetName) + text(it.displayName) } } } diff --git a/plugins/base/src/main/kotlin/renderers/html/htmlPreprocessors.kt b/plugins/base/src/main/kotlin/renderers/html/htmlPreprocessors.kt index f10c85d5..cdb30555 100644 --- a/plugins/base/src/main/kotlin/renderers/html/htmlPreprocessors.kt +++ b/plugins/base/src/main/kotlin/renderers/html/htmlPreprocessors.kt @@ -87,7 +87,7 @@ object StyleAndScriptsAppender : PageTransformer { class SourcesetDependencyAppender(val context: DokkaContext) : PageTransformer{ override fun invoke(input: RootPageNode): RootPageNode { val dependenciesMap = context.configuration.passesConfigurations.map { - it.sourceSetName to it.dependentSourceSets + it.sourceSetID to it.dependentSourceSets }.toMap() fun createDependenciesJson() : String = "sourceset_dependencies = '{${ dependenciesMap.entries.joinToString(", ") { diff --git a/plugins/base/src/main/kotlin/resolvers/local/DefaultLocationProvider.kt b/plugins/base/src/main/kotlin/resolvers/local/DefaultLocationProvider.kt index 322f4927..a9e58f17 100644 --- a/plugins/base/src/main/kotlin/resolvers/local/DefaultLocationProvider.kt +++ b/plugins/base/src/main/kotlin/resolvers/local/DefaultLocationProvider.kt @@ -98,26 +98,19 @@ open class DefaultLocationProvider( if (info == null) { toResolve.getOrPut(jdk) { mutableListOf() }.add(link) } else if (info.packages.contains(dri.packageName)) { - return link.url.toExternalForm() + getLink( - dri, - info - ) + return link.url.toExternalForm() + getLink(dri, info) } } } // Not in cache, resolve packageLists for ((jdk, links) in toResolve) { for (link in links) { + if(dokkaContext.configuration.offlineMode && link.packageListUrl.protocol.toLowerCase() != "file") + continue val locationInfo = - loadPackageList( - jdk, - link.packageListUrl - ) + loadPackageList(jdk, link.packageListUrl) if (locationInfo.packages.contains(dri.packageName)) { - return link.url.toExternalForm() + getLink( - dri, - locationInfo - ) + return link.url.toExternalForm() + getLink(dri, locationInfo) } } toResolve.remove(jdk) diff --git a/plugins/base/src/main/kotlin/transformers/documentables/ModuleAndPackageDocumentationTransformer.kt b/plugins/base/src/main/kotlin/transformers/documentables/ModuleAndPackageDocumentationTransformer.kt index 04b2636c..2aab6018 100644 --- a/plugins/base/src/main/kotlin/transformers/documentables/ModuleAndPackageDocumentationTransformer.kt +++ b/plugins/base/src/main/kotlin/transformers/documentables/ModuleAndPackageDocumentationTransformer.kt @@ -53,7 +53,7 @@ internal class ModuleAndPackageDocumentationTransformer(val context: DokkaContex module.sourceSets.mapNotNull { pd -> val doc = modulesAndPackagesDocumentation[Pair(module.name, pd)] val facade = context.platforms[pd]?.facade - ?: return@mapNotNull null.also { context.logger.warn("Could not find platform data for ${pd.moduleName}/${pd.sourceSetName}") } + ?: return@mapNotNull null.also { context.logger.warn("Could not find platform data for ${pd.moduleName}/${pd.sourceSetID}") } try { doc?.get("Module")?.get(module.name)?.run { pd to MarkdownParser( @@ -72,7 +72,7 @@ internal class ModuleAndPackageDocumentationTransformer(val context: DokkaContex it.name to it.sourceSets.mapNotNull { pd -> val doc = modulesAndPackagesDocumentation[Pair(module.name, pd)] val facade = context.platforms[pd]?.facade - ?: return@mapNotNull null.also { context.logger.warn("Could not find platform data for ${pd.moduleName}/${pd.sourceSetName}") } + ?: return@mapNotNull null.also { context.logger.warn("Could not find platform data for ${pd.moduleName}/${pd.sourceSetID}") } val descriptor = facade.moduleDescriptor.getPackage(FqName(it.name.let { if(it == "[JS root]") "" else it })) doc?.get("Package")?.get(it.name)?.run { pd to MarkdownParser( diff --git a/plugins/base/src/main/kotlin/translators/descriptors/DefaultDescriptorToDocumentableTranslator.kt b/plugins/base/src/main/kotlin/translators/descriptors/DefaultDescriptorToDocumentableTranslator.kt index bf92c849..33cad4f5 100644 --- a/plugins/base/src/main/kotlin/translators/descriptors/DefaultDescriptorToDocumentableTranslator.kt +++ b/plugins/base/src/main/kotlin/translators/descriptors/DefaultDescriptorToDocumentableTranslator.kt @@ -739,7 +739,7 @@ private class DokkaDescriptorVisitor( private fun ConstantsEnumValue.fullEnumEntryName() = "${this.enumClassId.relativeClassName.asString()}.${this.enumEntryName.identifier}" - private fun fallbackPackageName(): String = "[${sourceSet.sourceSetName} root]"// TODO: error-prone, find a better way to do it + private fun fallbackPackageName(): String = "[${sourceSet.displayName} root]"// TODO: error-prone, find a better way to do it } private fun DRI.withPackageFallbackTo(fallbackPackage: String): DRI { |