aboutsummaryrefslogtreecommitdiff
path: root/plugins/base
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/base')
-rw-r--r--plugins/base/src/main/kotlin/translators/documentables/DefaultPageCreator.kt72
1 files changed, 46 insertions, 26 deletions
diff --git a/plugins/base/src/main/kotlin/translators/documentables/DefaultPageCreator.kt b/plugins/base/src/main/kotlin/translators/documentables/DefaultPageCreator.kt
index 6988afee..f29b05fb 100644
--- a/plugins/base/src/main/kotlin/translators/documentables/DefaultPageCreator.kt
+++ b/plugins/base/src/main/kotlin/translators/documentables/DefaultPageCreator.kt
@@ -42,17 +42,21 @@ open class DefaultPageCreator(
open fun pageForFunction(f: DFunction) = MemberPageNode(f.name, contentForFunction(f), setOf(f.dri), f)
protected open fun contentForModule(m: DModule) = contentBuilder.contentFor(m) {
- header(1) { text(m.name) }
- block("Packages", 2, ContentKind.Packages, m.packages, m.platformData.toSet()) {
- link(it.name, it.dri)
+ platformDependentHint(m.dri,m.platformData.toSet()){
+ header(1) { text(m.name) }
+ block("Packages", 2, ContentKind.Packages, m.packages, m.platformData.toSet()) {
+ link(it.name, it.dri)
+ }
}
// text("Index\n") TODO
// text("Link to allpage here")
}
protected open fun contentForPackage(p: DPackage) = contentBuilder.contentFor(p) {
- header(1) { text("Package ${p.name}") }
- +contentForScope(p, p.dri, p.platformData)
+ platformDependentHint(p.dri,p.platformData.toSet()){
+ header(1) { text("Package ${p.name}") }
+ +contentForScope(p, p.dri, p.platformData)
+ }
}
protected open fun contentForScope(
@@ -61,30 +65,35 @@ open class DefaultPageCreator(
platformData: List<PlatformData>
) = contentBuilder.contentFor(s as Documentable) {
block("Types", 2, ContentKind.Classlikes, s.classlikes, platformData.toSet()) {
- link(it.name.orEmpty(), it.dri)
- group {
- +buildSignature(it)
- group(kind = ContentKind.BriefComment) {
- text(it.briefDocumentation())
+ platformDependentHint(it.dri,it.platformData.toSet()){
+ link(it.name.orEmpty(), it.dri)
+ group {
+ +buildSignature(it)
+ group(kind = ContentKind.BriefComment) {
+ text(it.briefDocumentation())
+ }
}
}
}
block("Functions", 2, ContentKind.Functions, s.functions, platformData.toSet()) {
- link(it.name, it.dri)
- group {
- +buildSignature(it)
-
- group(kind = ContentKind.BriefComment) {
- text(it.briefDocumentation())
+ platformDependentHint(it.dri,it.platformData.toSet()){
+ link(it.name, it.dri)
+ group {
+ +buildSignature(it)
+ group(kind = ContentKind.BriefComment) {
+ text(it.briefDocumentation())
+ }
}
}
}
block("Properties", 2, ContentKind.Properties, s.properties, platformData.toSet()) {
- link(it.name, it.dri)
- +buildSignature(it)
- breakLine()
- group(kind = ContentKind.BriefComment) {
- text(it.briefDocumentation())
+ platformDependentHint(it.dri,it.platformData.toSet()){
+ link(it.name, it.dri)
+ +buildSignature(it)
+ breakLine()
+ group(kind = ContentKind.BriefComment) {
+ text(it.briefDocumentation())
+ }
}
}
(s as? WithExtraProperties<Documentable>)?.let { it.extra[InheritorsInfo] }?.let { inheritors ->
@@ -133,20 +142,31 @@ open class DefaultPageCreator(
// TODO: this probably needs fixing
d.documentation.forEach { _, documentationNode ->
documentationNode.children.filter(filtering).forEach {
- header(3) {
- text(it.toHeaderString())
- d.documentation.keys.joinToString(prefix = "[", postfix = "]", separator = ", ")
+ platformDependentHint(d.dri,d.platformData.toSet()){
+ header(3) {
+ text(it.toHeaderString())
+ d.documentation.keys.joinToString(prefix = "[", postfix = "]", separator = ", ")
+ }
+ comment(it.root)
+ text("\n")
}
- comment(it.root)
- text("\n")
}
}
}.children
+<<<<<<< HEAD
protected open fun contentForFunction(f: DFunction) = contentBuilder.contentFor(f) {
header(1) { text(f.name) }
+buildSignature(f)
+contentForComments(f)
+=======
+ protected open fun contentForFunction(f: Function) = contentBuilder.contentFor(f) {
+ platformDependentHint(f.dri,f.platformData.toSet()){
+ header(1) { text(f.name) }
+ +buildSignature(f)
+ +contentForComments(f)
+ }
+>>>>>>> Added platformDepndentHints for platform-dependent contents
}
protected open fun TagWrapper.toHeaderString() = this.javaClass.toGenericString().split('.').last()