From abc0d2791a47635e4ce909041e7705de4121bb05 Mon Sep 17 00:00:00 2001 From: Andrzej Ratajczak Date: Tue, 5 May 2020 15:07:55 +0200 Subject: Introduce requested changes --- .../descriptors/DefaultDescriptorToDocumentableTranslator.kt | 9 ++++----- .../main/kotlin/translators/documentables/DefaultPageCreator.kt | 2 +- 2 files changed, 5 insertions(+), 6 deletions(-) (limited to 'plugins/base/src/main/kotlin/translators') diff --git a/plugins/base/src/main/kotlin/translators/descriptors/DefaultDescriptorToDocumentableTranslator.kt b/plugins/base/src/main/kotlin/translators/descriptors/DefaultDescriptorToDocumentableTranslator.kt index 00e3239c..128b9bd4 100644 --- a/plugins/base/src/main/kotlin/translators/descriptors/DefaultDescriptorToDocumentableTranslator.kt +++ b/plugins/base/src/main/kotlin/translators/descriptors/DefaultDescriptorToDocumentableTranslator.kt @@ -500,14 +500,13 @@ private class DokkaDescriptorVisitor( .filter { it.kind == ClassKind.ENUM_ENTRY } .map { enumEntryDescriptor(it, parent) } - private fun DeclarationDescriptor.resolveDescriptorData(platformData: PlatformData?): PlatformDependent { - val documentation = getDocumentation() - return if (documentation.children.isEmpty()) + private fun DeclarationDescriptor.resolveDescriptorData(platformData: PlatformData?): PlatformDependent = getDocumentation().let { + if (it.children.isEmpty()) PlatformDependent.empty() else if (platformData != null) - PlatformDependent.from(platformData, documentation) + PlatformDependent.from(platformData, it) else - PlatformDependent.expectFrom(documentation) + PlatformDependent.expectFrom(it) } private fun ClassDescriptor.resolveClassDescriptionData(platformData: PlatformData?): ClassInfo { diff --git a/plugins/base/src/main/kotlin/translators/documentables/DefaultPageCreator.kt b/plugins/base/src/main/kotlin/translators/documentables/DefaultPageCreator.kt index dd28b533..9c7abdd9 100644 --- a/plugins/base/src/main/kotlin/translators/documentables/DefaultPageCreator.kt +++ b/plugins/base/src/main/kotlin/translators/documentables/DefaultPageCreator.kt @@ -268,7 +268,7 @@ open class DefaultPageCreator( platforms.forEach { header(4, kind = ContentKind.Comment, platformData = setOf(it)) { text("See also") } } - table(kind = ContentKind.Comment) { + table(kind = ContentKind.Sample) { platforms.flatMap { platform -> seeAlsoTags.mapNotNull { (_, see) -> see.getOrExpect(platform)?.let { -- cgit