aboutsummaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'plugins')
-rw-r--r--plugins/base/src/main/kotlin/translators/documentables/DefaultPageCreator.kt21
1 files changed, 21 insertions, 0 deletions
diff --git a/plugins/base/src/main/kotlin/translators/documentables/DefaultPageCreator.kt b/plugins/base/src/main/kotlin/translators/documentables/DefaultPageCreator.kt
index 177d5021..e8cdb2cf 100644
--- a/plugins/base/src/main/kotlin/translators/documentables/DefaultPageCreator.kt
+++ b/plugins/base/src/main/kotlin/translators/documentables/DefaultPageCreator.kt
@@ -245,6 +245,26 @@ open class DefaultPageCreator(
}
}
+ fun DocumentableContentBuilder.contentForSeeAlso() {
+ val seeAlsoTags = tags.withTypeNamed<See>()
+ if(seeAlsoTags.isNotEmpty()) {
+ header(4, kind = ContentKind.Comment) { text("See also") }
+ table(kind = ContentKind.Comment) {
+ platforms.flatMap { platform ->
+ seeAlsoTags.mapNotNull { (_, see) ->
+ see.getOrExpect(platform)?.let {
+ buildGroup {
+ if (it.address != null) link(it.name, it.address!!)
+ else text(it.name)
+ comment(it.root)
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+
fun DocumentableContentBuilder.contentForUnnamedTags() {
val unnamedTags: List<PlatformDependent<TagWrapper>> =
tags.filterNot { (k, _) -> k.isSubclassOf(NamedTagWrapper::class) || k in specialTags }
@@ -268,6 +288,7 @@ open class DefaultPageCreator(
contentForDescription()
contentForParams()
contentForUnnamedTags()
+ contentForSeeAlso()
}
}
}.children