From c2b02c1fc17b839075b7cb6fd42498a519473fae Mon Sep 17 00:00:00 2001 From: Błażej Kardyś Date: Mon, 3 Aug 2020 03:57:48 +0200 Subject: Deprecated elements page for javadoc format --- .../DeprecatedDocumentableFilterTransformer.kt | 6 ------ .../src/main/kotlin/transformers/documentables/utils.kt | 16 ++++++++++++++++ 2 files changed, 16 insertions(+), 6 deletions(-) create mode 100644 plugins/base/src/main/kotlin/transformers/documentables/utils.kt (limited to 'plugins/base/src/main/kotlin') diff --git a/plugins/base/src/main/kotlin/transformers/documentables/DeprecatedDocumentableFilterTransformer.kt b/plugins/base/src/main/kotlin/transformers/documentables/DeprecatedDocumentableFilterTransformer.kt index 109aa640..66156832 100644 --- a/plugins/base/src/main/kotlin/transformers/documentables/DeprecatedDocumentableFilterTransformer.kt +++ b/plugins/base/src/main/kotlin/transformers/documentables/DeprecatedDocumentableFilterTransformer.kt @@ -28,12 +28,6 @@ class DeprecatedDocumentableFilterTransformer(val context: DokkaContext) : PreMe }?.skipDeprecated ?: globalOptions.skipDeprecated - fun T.isDeprecated() = extra[Annotations]?.let { annotations -> - annotations.content.values.flatten().any { - it.dri.toString() == "kotlin/Deprecated///PointingToDeclaration/" - } - } ?: false - return !(condition && this.isDeprecated()) } diff --git a/plugins/base/src/main/kotlin/transformers/documentables/utils.kt b/plugins/base/src/main/kotlin/transformers/documentables/utils.kt new file mode 100644 index 00000000..a8f13ad8 --- /dev/null +++ b/plugins/base/src/main/kotlin/transformers/documentables/utils.kt @@ -0,0 +1,16 @@ +package org.jetbrains.dokka.base.transformers.documentables + +import org.jetbrains.dokka.model.Annotations +import org.jetbrains.dokka.model.Documentable +import org.jetbrains.dokka.model.properties.WithExtraProperties + +fun T.isDeprecated() where T : WithExtraProperties = + deprecatedAnnotation != null + +val T.deprecatedAnnotation where T : WithExtraProperties + get() = extra[Annotations]?.let { annotations -> + annotations.content.values.flatten().firstOrNull { + it.dri.toString() == "kotlin/Deprecated///PointingToDeclaration/" || + it.dri.toString() == "java.lang/Deprecated///PointingToDeclaration/" + } + } \ No newline at end of file -- cgit