Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/multiplatform-support' into tmp-…
Browse files Browse the repository at this point in the history
…-release--0.10.0
  • Loading branch information
semoro committed Oct 3, 2019
2 parents 06fb0d8 + a28db3c commit de2f32d
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 17 deletions.
11 changes: 5 additions & 6 deletions core/src/main/kotlin/Formats/StructuredFormatService.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down
8 changes: 7 additions & 1 deletion core/src/main/kotlin/Generation/DocumentationMerger.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion core/src/main/kotlin/Kotlin/DocumentationBuilder.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 1 addition & 9 deletions core/src/test/kotlin/model/PackageTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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())
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
jvm.html
kotlin.-string/
index.html
my-extension.html
main.html
shared.html
package-list
Expand Down

0 comments on commit de2f32d

Please sign in to comment.