aboutsummaryrefslogtreecommitdiff
path: root/plugins/base/src/main/kotlin/translators
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/base/src/main/kotlin/translators')
-rw-r--r--plugins/base/src/main/kotlin/translators/documentables/DefaultPageCreator.kt8
1 files changed, 7 insertions, 1 deletions
diff --git a/plugins/base/src/main/kotlin/translators/documentables/DefaultPageCreator.kt b/plugins/base/src/main/kotlin/translators/documentables/DefaultPageCreator.kt
index a702766e..e6f92d6b 100644
--- a/plugins/base/src/main/kotlin/translators/documentables/DefaultPageCreator.kt
+++ b/plugins/base/src/main/kotlin/translators/documentables/DefaultPageCreator.kt
@@ -37,7 +37,7 @@ open class DefaultPageCreator(
open fun pageForPackage(p: DPackage): PackagePageNode = PackagePageNode(
p.name, contentForPackage(p), setOf(p.dri), p,
p.classlikes.renameClashingClasslikes().map(::pageForClasslike) +
- p.functions.map(::pageForFunction)
+ p.functions.map(::pageForFunction) + p.properties.mapNotNull(::pageForProperty)
)
open fun pageForEnumEntry(e: DEnumEntry): ClasslikePageNode =
@@ -55,7 +55,9 @@ open class DefaultPageCreator(
constructors.map(::pageForFunction) +
c.classlikes.renameClashingClasslikes().map(::pageForClasslike) +
c.filteredFunctions.map(::pageForFunction) +
+ c.properties.mapNotNull(::pageForProperty) +
if (c is DEnum) c.entries.map(::pageForEnumEntry) else emptyList()
+
)
}
@@ -74,6 +76,8 @@ open class DefaultPageCreator(
open fun pageForFunction(f: DFunction) = MemberPageNode(f.name, contentForFunction(f), setOf(f.dri), f)
+ open fun pageForProperty(p: DProperty): MemberPageNode? = MemberPageNode(p.name, contentForProperty(p), setOf(p.dri), p)
+
private val WithScope.filteredFunctions: List<DFunction>
get() = functions.mapNotNull { function ->
function.takeIf {
@@ -476,6 +480,8 @@ open class DefaultPageCreator(
protected open fun contentForFunction(f: DFunction) = contentForMember(f)
+ protected open fun contentForProperty(p: DProperty) = contentForMember(p)
+
protected open fun contentForMember(d: Documentable) = contentBuilder.contentFor(d) {
group(kind = ContentKind.Cover) {
cover(d.name.orEmpty())