diff options
Diffstat (limited to 'plugins/base/src/main/kotlin/translators')
-rw-r--r-- | plugins/base/src/main/kotlin/translators/documentables/DefaultPageCreator.kt | 26 |
1 files changed, 22 insertions, 4 deletions
diff --git a/plugins/base/src/main/kotlin/translators/documentables/DefaultPageCreator.kt b/plugins/base/src/main/kotlin/translators/documentables/DefaultPageCreator.kt index a6dd337a..8c7707f8 100644 --- a/plugins/base/src/main/kotlin/translators/documentables/DefaultPageCreator.kt +++ b/plugins/base/src/main/kotlin/translators/documentables/DefaultPageCreator.kt @@ -247,6 +247,8 @@ open class DefaultPageCreator( } } } + + contentForSinceKotlin(d) }.children } @@ -352,9 +354,9 @@ open class DefaultPageCreator( }.children } - protected open fun DocumentableContentBuilder.contentForBrief(content: Documentable) { - content.sourceSets.forEach { sourceSet -> - content.documentation[sourceSet]?.children?.firstOrNull()?.root?.let { + protected open fun DocumentableContentBuilder.contentForBrief(documentable: Documentable) { + documentable.sourceSets.forEach { sourceSet -> + documentable.documentation[sourceSet]?.children?.firstOrNull()?.root?.let { group(sourceSets = setOf(sourceSet), kind = ContentKind.BriefComment) { comment(it) } @@ -362,6 +364,21 @@ open class DefaultPageCreator( } } + protected open fun DocumentableContentBuilder.contentForSinceKotlin(documentable: Documentable) { + documentable.documentation.mapValues { + it.value.children.find { it is CustomTagWrapper && it.name == "Since Kotlin" } as CustomTagWrapper? + }.run { + documentable.sourceSets.forEach { sourceSet -> + this[sourceSet]?.also { tag -> + group(sourceSets = setOf(sourceSet)) { + header(4, (tag as CustomTagWrapper).name) + comment(tag.root) + } + } + } + } + } + protected open fun contentForFunction(f: DFunction) = contentForMember(f) protected open fun contentForTypeAlias(t: DTypeAlias) = contentForMember(t) protected open fun contentForMember(d: Documentable) = contentBuilder.contentFor(d) { @@ -385,7 +402,7 @@ open class DefaultPageCreator( name: String, collection: Collection<Documentable>, kind: ContentKind, - extra: PropertyContainer<ContentNode> = mainExtra, + extra: PropertyContainer<ContentNode> = mainExtra ) { if (collection.any()) { header(2, name) @@ -405,6 +422,7 @@ open class DefaultPageCreator( instance(setOf(it.dri), it.sourceSets.toSet()) { before { contentForBrief(it) + contentForSinceKotlin(it) } divergent { group { |