diff options
author | Marcin Aman <marcin.aman@gmail.com> | 2021-04-06 18:06:42 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-04-06 18:06:42 +0200 |
commit | 5afe512c669e68aea3712ac37b67d005657cf60a (patch) | |
tree | 2a2ec579a16bf32b93dbcd1adaa8961c2c875b59 /plugins/base/src/main | |
parent | cd071a5e07c8202c66db2e077ea43bea76d55511 (diff) | |
download | dokka-5afe512c669e68aea3712ac37b67d005657cf60a.tar.gz dokka-5afe512c669e68aea3712ac37b67d005657cf60a.tar.bz2 dokka-5afe512c669e68aea3712ac37b67d005657cf60a.zip |
Suppress inherited members (#1814)
Diffstat (limited to 'plugins/base/src/main')
-rw-r--r-- | plugins/base/src/main/kotlin/DokkaBase.kt | 11 | ||||
-rw-r--r-- | plugins/base/src/main/kotlin/transformers/documentables/InheritedEntriesDocumentableFilterTransformer.kt | 13 |
2 files changed, 20 insertions, 4 deletions
diff --git a/plugins/base/src/main/kotlin/DokkaBase.kt b/plugins/base/src/main/kotlin/DokkaBase.kt index d84207a5..0a18c3b1 100644 --- a/plugins/base/src/main/kotlin/DokkaBase.kt +++ b/plugins/base/src/main/kotlin/DokkaBase.kt @@ -82,6 +82,10 @@ class DokkaBase : DokkaPlugin() { preMergeDocumentableTransformer providing ::ObviousFunctionsDocumentableFilterTransformer } + val inheritedEntriesVisbilityFilter by extending { + preMergeDocumentableTransformer providing ::InheritedEntriesDocumentableFilterTransformer + } + val emptyPackagesFilter by extending { preMergeDocumentableTransformer providing ::EmptyPackagesFilterTransformer order { after( @@ -89,7 +93,8 @@ class DokkaBase : DokkaPlugin() { suppressedDocumentableFilter, documentableVisibilityFilter, suppressedBySuppressTagDocumentableFilter, - obviousFunctionsVisbilityFilter + obviousFunctionsVisbilityFilter, + inheritedEntriesVisbilityFilter, ) } } @@ -120,7 +125,6 @@ class DokkaBase : DokkaPlugin() { CoreExtensions.documentableTransformer with InheritorsExtractorTransformer() } - val undocumentedCodeReporter by extending { CoreExtensions.documentableTransformer with ReportUndocumentedTransformer() } @@ -163,7 +167,6 @@ class DokkaBase : DokkaPlugin() { CoreExtensions.renderer providing ::HtmlRenderer } - val defaultKotlinAnalysis by extending { kotlinAnalysis providing { ctx -> KotlinAnalysis(ctx.configuration.sourceSets, ctx.logger) } } @@ -246,4 +249,4 @@ class DokkaBase : DokkaPlugin() { val baseSearchbarDataInstaller by extending { htmlPreprocessors providing ::SearchbarDataInstaller order { after(sourceLinksTransformer) } } -}
\ No newline at end of file +} diff --git a/plugins/base/src/main/kotlin/transformers/documentables/InheritedEntriesDocumentableFilterTransformer.kt b/plugins/base/src/main/kotlin/transformers/documentables/InheritedEntriesDocumentableFilterTransformer.kt new file mode 100644 index 00000000..a1b5052d --- /dev/null +++ b/plugins/base/src/main/kotlin/transformers/documentables/InheritedEntriesDocumentableFilterTransformer.kt @@ -0,0 +1,13 @@ +package org.jetbrains.dokka.base.transformers.documentables + +import org.jetbrains.dokka.model.* +import org.jetbrains.dokka.model.properties.WithExtraProperties +import org.jetbrains.dokka.plugability.DokkaContext + +class InheritedEntriesDocumentableFilterTransformer(context: DokkaContext) : + SuppressedByConditionDocumentableFilterTransformer(context) { + override fun shouldBeSuppressed(d: Documentable): Boolean = + context.configuration.suppressInheritedMembers && (d as? WithExtraProperties<Documentable>)?.extra?.get( + InheritedMember + )?.inheritedFrom?.any { entry -> entry.value != null } ?: false +}
\ No newline at end of file |