aboutsummaryrefslogtreecommitdiff
path: root/plugins/base
diff options
context:
space:
mode:
authorFilip Zybała <fzybala@virtuslab.com>2020-04-01 17:20:44 +0200
committerPaweł Marks <Kordyjan@users.noreply.github.com>2020-04-06 14:23:54 +0200
commit2b921897aa90216d78e05165d5ce122814ead74c (patch)
treef89765c4bd17a1af3651596c377b84e3f0d146c6 /plugins/base
parenta1866dd98d291a6a2a538e88348c53ff08c812eb (diff)
downloaddokka-2b921897aa90216d78e05165d5ce122814ead74c.tar.gz
dokka-2b921897aa90216d78e05165d5ce122814ead74c.tar.bz2
dokka-2b921897aa90216d78e05165d5ce122814ead74c.zip
Changed see also parsing, added see also section to pages
Diffstat (limited to 'plugins/base')
-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