diff options
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) = |