diff options
Diffstat (limited to 'plugins/javadoc')
3 files changed, 13 insertions, 11 deletions
diff --git a/plugins/javadoc/src/main/kotlin/org/jetbrains/dokka/javadoc/location/JavadocLocationProvider.kt b/plugins/javadoc/src/main/kotlin/org/jetbrains/dokka/javadoc/location/JavadocLocationProvider.kt index d5499f0b..9b0d8b04 100644 --- a/plugins/javadoc/src/main/kotlin/org/jetbrains/dokka/javadoc/location/JavadocLocationProvider.kt +++ b/plugins/javadoc/src/main/kotlin/org/jetbrains/dokka/javadoc/location/JavadocLocationProvider.kt @@ -76,7 +76,7 @@ class JavadocLocationProvider(pageRoot: RootPageNode, dokkaContext: DokkaContext "${resolve(it, context, skipExtension = true)}.html#$anchor" } ?: getExternalLocation(dri, sourceSets) - } + private fun JavadocFunctionNode.getAnchor(): String = "$name(${parameters.joinToString(",") { @@ -89,18 +89,20 @@ class JavadocLocationProvider(pageRoot: RootPageNode, dokkaContext: DokkaContext is JavaObject -> "Object" else -> bound.toString() } - }})" + })" fun anchorForFunctionNode(node: JavadocFunctionNode) = node.getAnchor() private fun anchorForDri(dri: DRI): String = dri.callable?.let { callable -> - "${callable.name}(${callable.params.joinToString(",") { - ((it as? Nullable)?.wrapped ?: it).toString() - }})" + "${callable.name}(${ + callable.params.joinToString(",") { + ((it as? Nullable)?.wrapped ?: it).toString() + } + })" } ?: dri.classNames.orEmpty() - override fun resolve(node: PageNode, context: PageNode?, skipExtension: Boolean): String = + override fun resolve(node: PageNode, context: PageNode?, skipExtension: Boolean) = pathIndex[node]?.relativeTo(pathIndex[context].orEmpty())?.let { if (skipExtension) it.removeSuffix(".html") else it } ?: run { diff --git a/plugins/javadoc/src/main/kotlin/org/jetbrains/dokka/javadoc/renderer/KorteJavadocRenderer.kt b/plugins/javadoc/src/main/kotlin/org/jetbrains/dokka/javadoc/renderer/KorteJavadocRenderer.kt index 4d5b9a6c..669f4979 100644 --- a/plugins/javadoc/src/main/kotlin/org/jetbrains/dokka/javadoc/renderer/KorteJavadocRenderer.kt +++ b/plugins/javadoc/src/main/kotlin/org/jetbrains/dokka/javadoc/renderer/KorteJavadocRenderer.kt @@ -148,7 +148,7 @@ class KorteJavadocRenderer(private val outputWriter: OutputWriter, val context: " implements " + it.joinToString(", ") { n -> listOfNotNull( n.packageName, - buildLink(n.toLink(), n.classNames.orEmpty()) + n.toLink()?.let{ buildLink(it, n.classNames.orEmpty()) } ?: n ).joinToString(".") } }.orEmpty() diff --git a/plugins/javadoc/src/main/kotlin/org/jetbrains/dokka/javadoc/renderer/SearchScriptsCreator.kt b/plugins/javadoc/src/main/kotlin/org/jetbrains/dokka/javadoc/renderer/SearchScriptsCreator.kt index cc1995eb..736a1f93 100644 --- a/plugins/javadoc/src/main/kotlin/org/jetbrains/dokka/javadoc/renderer/SearchScriptsCreator.kt +++ b/plugins/javadoc/src/main/kotlin/org/jetbrains/dokka/javadoc/renderer/SearchScriptsCreator.kt @@ -103,7 +103,7 @@ class SearchScriptsCreator(private val locationProvider: JavadocLocationProvider packageName = it.first.name, classlikeName = it.second.name, input = function, - url = locationProvider.resolve(function.dri, it.first.sourceSets()) + url = locationProvider.resolve(function.dri, it.first.sourceSets())!! ) } } @@ -114,7 +114,7 @@ class SearchScriptsCreator(private val locationProvider: JavadocLocationProvider packageName = it.first.name, classlikeName = it.second.name, property, - locationProvider.resolve(property.dri, it.first.sourceSets()) + locationProvider.resolve(property.dri, it.first.sourceSets())!! ) } } @@ -125,7 +125,7 @@ class SearchScriptsCreator(private val locationProvider: JavadocLocationProvider packageName = it.first.name, classlikeName = it.second.name, entry, - locationProvider.resolve(entry.dri, it.first.sourceSets()) + locationProvider.resolve(entry.dri, it.first.sourceSets())!! ) } } @@ -185,7 +185,7 @@ class SearchScriptsCreator(private val locationProvider: JavadocLocationProvider sourceSets: Set<DisplaySourceSet>, label: String ): String = - locationProvider.resolve(dri, sourceSets).formatToEndWithHtml() + "#" + label + locationProvider.resolve(dri, sourceSets)!!.formatToEndWithHtml() + "#" + label } private data class SearchRecord( |