diff options
author | Paweł Marks <pmarks@virtuslab.com> | 2020-03-11 17:50:31 +0100 |
---|---|---|
committer | Paweł Marks <Kordyjan@users.noreply.github.com> | 2020-03-11 18:15:55 +0100 |
commit | 93b8ae8a552ed88f50e4f17a5906ddeedb77e639 (patch) | |
tree | 03fa1ce1ae08822b7225a8e6e2f52aa28c7d44f3 | |
parent | f48bffb05efcfd03cf72189ab13472c196f2a948 (diff) | |
download | dokka-93b8ae8a552ed88f50e4f17a5906ddeedb77e639.tar.gz dokka-93b8ae8a552ed88f50e4f17a5906ddeedb77e639.tar.bz2 dokka-93b8ae8a552ed88f50e4f17a5906ddeedb77e639.zip |
Add filtering for comments
-rw-r--r-- | plugins/base/src/main/kotlin/translators/documentables/DefaultPageCreator.kt | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/plugins/base/src/main/kotlin/translators/documentables/DefaultPageCreator.kt b/plugins/base/src/main/kotlin/translators/documentables/DefaultPageCreator.kt index 9bc06ae8..1f7f0b01 100644 --- a/plugins/base/src/main/kotlin/translators/documentables/DefaultPageCreator.kt +++ b/plugins/base/src/main/kotlin/translators/documentables/DefaultPageCreator.kt @@ -5,6 +5,7 @@ import org.jetbrains.dokka.base.transformers.pages.comments.CommentsToContentCon import org.jetbrains.dokka.links.DRI import org.jetbrains.dokka.model.* import org.jetbrains.dokka.model.Function +import org.jetbrains.dokka.model.doc.Property import org.jetbrains.dokka.model.doc.TagWrapper import org.jetbrains.dokka.pages.* import org.jetbrains.dokka.utilities.DokkaLogger @@ -89,7 +90,7 @@ open class DefaultPageCreator( protected open fun contentForClasslike(c: Classlike) = contentBuilder.contentFor(c) { header(1) { text(c.name.orEmpty()) } +buildSignature(c) - +contentForComments(c) + +contentForComments(c) { it !is Property } if (c is WithConstructors) { block("Constructors", 2, ContentKind.Constructors, c.constructors, c.platformData.toSet()) { @@ -106,10 +107,13 @@ open class DefaultPageCreator( +contentForScope(c, c.dri, c.platformData) } - protected open fun contentForComments(d: Documentable) = contentBuilder.contentFor(d) { + protected open fun contentForComments( + d: Documentable, + filtering: (TagWrapper) -> Boolean = { true } + ) = contentBuilder.contentFor(d) { // TODO: this probably needs fixing d.documentation.forEach { _, documentationNode -> - documentationNode.children.forEach { + documentationNode.children.filter(filtering).forEach { header(3) { text(it.toHeaderString()) d.documentation.keys.joinToString(prefix = "[", postfix = "]", separator = ", ") |