Skip to content

Commit

Permalink
Merge constructors
Browse files Browse the repository at this point in the history
  • Loading branch information
vmishenev committed Jan 19, 2022
1 parent 3be10e0 commit 8522be8
Showing 1 changed file with 12 additions and 9 deletions.
Expand Up @@ -371,27 +371,30 @@ open class DefaultPageCreator(
+contentForComments(documentables)
val csWithConstructor = cs.filterIsInstance<WithConstructors>()
if (csWithConstructor.isNotEmpty()) {
block(
val constructorsToDocumented = csWithConstructor.flatMap { it.constructors }
.filter { it.extra[PrimaryConstructorExtra] == null || it.documentation.isNotEmpty() }
multiBlock(
"Constructors",
2,
ContentKind.Constructors,
csWithConstructor.flatMap { it.constructors }
.filter { it.extra[PrimaryConstructorExtra] == null || it.documentation.isNotEmpty() },
constructorsToDocumented.groupBy { it.parameters }.map { (_,v) -> v.first().name to v },
@Suppress("UNCHECKED_CAST")
(csWithConstructor as List<Documentable>).sourceSets,
needsAnchors = true,
extra = PropertyContainer.empty<ContentNode>() + SimpleAttr.header("Constructors")
) {
link(it.name, it.dri, kind = ContentKind.Main)
) { key, ds ->
link(key, ds.first().dri, kind = ContentKind.Main)
sourceSetDependentHint(
it.dri,
it.sourceSets.toSet(),
ds.dri,
ds.sourceSets,
kind = ContentKind.SourceSetDependentHint,
styles = emptySet(),
extra = PropertyContainer.empty<ContentNode>()
) {
+buildSignature(it)
contentForBrief(it)
ds.forEach {
+buildSignature(it)
contentForBrief(it)
}
}
}
}
Expand Down

0 comments on commit 8522be8

Please sign in to comment.