aboutsummaryrefslogtreecommitdiff
path: root/plugins/base/src/main/kotlin/translators
diff options
context:
space:
mode:
authorAndrzej Ratajczak <andrzej.ratajczak98@gmail.com>2020-06-09 16:31:58 +0200
committerSebastian Sellmair <34319766+sellmair@users.noreply.github.com>2020-06-25 14:56:46 +0200
commitcc89f0b74a870303c854fcb892d469d4c8fb17a8 (patch)
treed0affdb4ad029926fedae5d3e0af6fcf150bfde2 /plugins/base/src/main/kotlin/translators
parent1183e09a7123c8f9665248235c5e33ba28e92780 (diff)
downloaddokka-cc89f0b74a870303c854fcb892d469d4c8fb17a8.tar.gz
dokka-cc89f0b74a870303c854fcb892d469d4c8fb17a8.tar.bz2
dokka-cc89f0b74a870303c854fcb892d469d4c8fb17a8.zip
Gives text presentation for `SinceKotlin` and hides it from rendering. Hides `Deprecated`. #944
Diffstat (limited to 'plugins/base/src/main/kotlin/translators')
-rw-r--r--plugins/base/src/main/kotlin/translators/documentables/DefaultPageCreator.kt26
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 {