diff options
5 files changed, 15 insertions, 17 deletions
diff --git a/core/src/main/kotlin/Formats/StructuredFormatService.kt b/core/src/main/kotlin/Formats/StructuredFormatService.kt index 7299670e..76f9366f 100644 --- a/core/src/main/kotlin/Formats/StructuredFormatService.kt +++ b/core/src/main/kotlin/Formats/StructuredFormatService.kt @@ -900,18 +900,17 @@ abstract class StructuredOutputBuilder(val to: StringBuilder, val platforms = effectivePlatformsForNode(type) appendIndexRow(platforms) { appendPlatforms(platforms) - appendHeader(level = 5) { - appendLink(link(node, type) { - if (it.kind == NodeKind.ExternalClass) it.name else it.qualifiedName() - }) - } - if (type.kind == NodeKind.ExternalClass) { val packageName = type.owner?.name if (packageName != null) { appendText(" (extensions in package $packageName)") } } + appendHeader(level = 5) { + appendLink(link(node, type) { + if (it.kind == NodeKind.ExternalClass) it.name else it.qualifiedName() + }) + } appendContent(type.summary) } diff --git a/core/src/main/kotlin/Generation/DocumentationMerger.kt b/core/src/main/kotlin/Generation/DocumentationMerger.kt index 5d53868a..53dc23a9 100644 --- a/core/src/main/kotlin/Generation/DocumentationMerger.kt +++ b/core/src/main/kotlin/Generation/DocumentationMerger.kt @@ -164,7 +164,13 @@ class DocumentationMerger( if (groupNode.kind == NodeKind.ExternalClass){ val refs = nodes.flatMap { it.allReferences() }.filter { it.kind != RefKind.Owner && it.kind != RefKind.TopLevelPage } - refs.forEach { it.to.append(groupNode, RefKind.TopLevelPage); groupNode.append(it.to, RefKind.Member) } + refs.forEach { + if (it.kind != RefKind.Link) { + it.to.dropReferences { ref -> ref.kind == RefKind.Owner } + it.to.append(groupNode, RefKind.Owner) + } + groupNode.append(it.to, it.kind) + } } // if nodes are classes, nested members should be also merged and diff --git a/core/src/main/kotlin/Kotlin/DocumentationBuilder.kt b/core/src/main/kotlin/Kotlin/DocumentationBuilder.kt index eb0399c7..3168e033 100644 --- a/core/src/main/kotlin/Kotlin/DocumentationBuilder.kt +++ b/core/src/main/kotlin/Kotlin/DocumentationBuilder.kt @@ -423,7 +423,7 @@ class DocumentationBuilder fun DocumentationModule.appendFragments(fragments: Collection<PackageFragmentDescriptor>, packageContent: Map<String, Content>, packageDocumentationBuilder: PackageDocumentationBuilder) { - val allFqNames = fragments.map { it.fqName }.distinct() + val allFqNames = fragments.filter{ it.isDocumented(passConfiguration) }.map { it.fqName }.distinct() for (packageName in allFqNames) { if (packageName.isRoot && !passConfiguration.includeRootPackage) continue diff --git a/core/src/test/kotlin/model/PackageTest.kt b/core/src/test/kotlin/model/PackageTest.kt index e20e6afa..47c88385 100644 --- a/core/src/test/kotlin/model/PackageTest.kt +++ b/core/src/test/kotlin/model/PackageTest.kt @@ -126,15 +126,7 @@ abstract class BasePackageTest(val analysisPlatform: Platform) { analysisPlatform = analysisPlatform ) ) { model -> - assertEquals(1, model.members.count()) - with(model.members.elementAt(0)) { - assertEquals(NodeKind.Package, kind) - assertEquals("simple.name", name) - assertEquals(Content.Empty, content) - assertTrue(details.none()) - assertTrue(members.none()) - assertTrue(links.none()) - } + assertEquals(0, model.members.count()) } } } diff --git a/runners/gradle-integration-tests/testData/multiplatformProject/fileTree.txt b/runners/gradle-integration-tests/testData/multiplatformProject/fileTree.txt index 51a5df94..e9cc847c 100644 --- a/runners/gradle-integration-tests/testData/multiplatformProject/fileTree.txt +++ b/runners/gradle-integration-tests/testData/multiplatformProject/fileTree.txt @@ -11,6 +11,7 @@ jvm.html kotlin.-string/ index.html + my-extension.html main.html shared.html package-list |