diff options
author | Kamil Doległo <kamilok1965@interia.pl> | 2020-08-14 14:59:04 +0200 |
---|---|---|
committer | Sebastian Sellmair <34319766+sellmair@users.noreply.github.com> | 2020-08-19 13:34:10 +0200 |
commit | c4e4343bdb8df16e49d4da118fccc076abdc928a (patch) | |
tree | 19113d8630d6a24507184876e9d064ec833bc965 /plugins/base/src/main/kotlin/renderers | |
parent | 28d6598bc749612f75a5c1a4210eb4b0f5aa1f6e (diff) | |
download | dokka-c4e4343bdb8df16e49d4da118fccc076abdc928a.tar.gz dokka-c4e4343bdb8df16e49d4da118fccc076abdc928a.tar.bz2 dokka-c4e4343bdb8df16e49d4da118fccc076abdc928a.zip |
Respect relocated declarations
Diffstat (limited to 'plugins/base/src/main/kotlin/renderers')
3 files changed, 10 insertions, 11 deletions
diff --git a/plugins/base/src/main/kotlin/renderers/DefaultRenderer.kt b/plugins/base/src/main/kotlin/renderers/DefaultRenderer.kt index 41dffa07..83a0fc5b 100644 --- a/plugins/base/src/main/kotlin/renderers/DefaultRenderer.kt +++ b/plugins/base/src/main/kotlin/renderers/DefaultRenderer.kt @@ -4,7 +4,6 @@ import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.coroutineScope import kotlinx.coroutines.launch import kotlinx.coroutines.runBlocking -import org.jetbrains.dokka.DokkaConfiguration.DokkaSourceSet import org.jetbrains.dokka.DokkaException import org.jetbrains.dokka.base.DokkaBase import org.jetbrains.dokka.base.resolvers.local.LocationProvider @@ -128,7 +127,7 @@ abstract class DefaultRenderer<T>( open fun T.buildDRILink( node: ContentDRILink, pageContext: ContentPage, - sourceSetRestriction: Set<DokkaSourceSet>? + sourceSetRestriction: Set<DisplaySourceSet>? ) { locationProvider.resolve(node.address, node.sourceSets, pageContext)?.let { address -> buildLink(address) { @@ -140,7 +139,7 @@ abstract class DefaultRenderer<T>( open fun T.buildResolvedLink( node: ContentResolvedLink, pageContext: ContentPage, - sourceSetRestriction: Set<DokkaSourceSet>? + sourceSetRestriction: Set<DisplaySourceSet>? ) { buildLink(node.address) { buildText(node.children, pageContext, sourceSetRestriction) diff --git a/plugins/base/src/main/kotlin/renderers/PackageListService.kt b/plugins/base/src/main/kotlin/renderers/PackageListService.kt index 42c8d66e..cde96290 100644 --- a/plugins/base/src/main/kotlin/renderers/PackageListService.kt +++ b/plugins/base/src/main/kotlin/renderers/PackageListService.kt @@ -22,14 +22,16 @@ class PackageListService(val context: DokkaContext) { fun visit(node: PageNode, parentDris: Set<DRI>) { if (node is PackagePageNode) { - packages.add(node.name) + node.name + .takeUnless { name -> name.startsWith("[") && name.endsWith("]") } // Do not include the package name for declarations without one + ?.let { packages.add(it) } } val contentPage = node.safeAs<ContentPage>() contentPage?.dri?.forEach { if (parentDris.isNotEmpty() && it.parent !in parentDris) { locationProvider.resolve(node) - ?.let { nodeLocation -> nonStandardLocations[it.toString()] = nodeLocation } + ?.let { nodeLocation -> nonStandardLocations[it.toString()] = nodeLocation } ?: context.logger.error("Cannot resolve path for ${node.name}!") } } @@ -52,4 +54,4 @@ class PackageListService(val context: DokkaContext) { companion object { const val DOKKA_PARAM_PREFIX = "\$dokka" } -}
\ No newline at end of file +} diff --git a/plugins/base/src/main/kotlin/renderers/html/HtmlRenderer.kt b/plugins/base/src/main/kotlin/renderers/html/HtmlRenderer.kt index 0d20e8ac..6c1fd472 100644 --- a/plugins/base/src/main/kotlin/renderers/html/HtmlRenderer.kt +++ b/plugins/base/src/main/kotlin/renderers/html/HtmlRenderer.kt @@ -6,13 +6,11 @@ import kotlinx.coroutines.runBlocking import kotlinx.html.* import kotlinx.html.stream.createHTML import org.jetbrains.dokka.DokkaSourceSetID -import org.jetbrains.dokka.Platform import org.jetbrains.dokka.base.DokkaBase import org.jetbrains.dokka.base.renderers.DefaultRenderer import org.jetbrains.dokka.base.renderers.TabSortingStrategy import org.jetbrains.dokka.links.DRI import org.jetbrains.dokka.model.DisplaySourceSet -import org.jetbrains.dokka.model.dfs import org.jetbrains.dokka.model.properties.PropertyContainer import org.jetbrains.dokka.model.sourceSetIDs import org.jetbrains.dokka.model.withDescendants @@ -557,7 +555,7 @@ open class HtmlRenderer( from: PageNode? = null, block: FlowContent.() -> Unit ) = locationProvider.resolve(to, platforms.toSet(), from)?.let { buildLink(it, block) } - ?: run { context.logger.error("Cannot resolve path for $to"); block() } + ?: run { context.logger.error("Cannot resolve path for `$to` from `$from`"); block() } override fun buildError(node: ContentNode) { context.logger.error("Unknown ContentNode type: $node") @@ -574,7 +572,7 @@ open class HtmlRenderer( override fun FlowContent.buildDRILink( node: ContentDRILink, pageContext: ContentPage, - sourceSetRestriction: Set<DokkaSourceSet>? + sourceSetRestriction: Set<DisplaySourceSet>? ) = locationProvider.resolve(node.address, node.sourceSets, pageContext)?.let { address -> buildLink(address) { buildText(node.children, pageContext, sourceSetRestriction) @@ -609,7 +607,7 @@ open class HtmlRenderer( override suspend fun renderPage(page: PageNode) { super.renderPage(page) if (page is ContentPage && page !is ModulePageNode && page !is PackagePageNode) - searchbarDataInstaller.processPage(page, locationProvider.resolve(page) ?: context.logger.error("Cannot resolve path for ${page.dri}")) + searchbarDataInstaller.processPage(page, locationProvider.resolve(page) ?: run { context.logger.error("Cannot resolve path for ${page.dri}"); ""}) } override fun FlowContent.buildText(textNode: ContentText) = |