diff options
author | Filip Zybała <fzybala@virtuslab.com> | 2020-04-01 17:20:44 +0200 |
---|---|---|
committer | Paweł Marks <Kordyjan@users.noreply.github.com> | 2020-04-06 14:23:54 +0200 |
commit | 2b921897aa90216d78e05165d5ce122814ead74c (patch) | |
tree | f89765c4bd17a1af3651596c377b84e3f0d146c6 /plugins/base | |
parent | a1866dd98d291a6a2a538e88348c53ff08c812eb (diff) | |
download | dokka-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.kt | 21 |
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 |