diff options
Diffstat (limited to 'core/src/main/kotlin/pages')
-rw-r--r-- | core/src/main/kotlin/pages/ContentNodes.kt | 29 | ||||
-rw-r--r-- | core/src/main/kotlin/pages/PageNodes.kt | 5 |
2 files changed, 16 insertions, 18 deletions
diff --git a/core/src/main/kotlin/pages/ContentNodes.kt b/core/src/main/kotlin/pages/ContentNodes.kt index 26bcdf77..bb669199 100644 --- a/core/src/main/kotlin/pages/ContentNodes.kt +++ b/core/src/main/kotlin/pages/ContentNodes.kt @@ -1,6 +1,7 @@ package org.jetbrains.dokka.pages import org.jetbrains.dokka.links.DRI +import org.jetbrains.dokka.model.SourceSetData import org.jetbrains.dokka.model.properties.PropertyContainer import org.jetbrains.dokka.model.properties.WithExtraProperties @@ -10,7 +11,7 @@ data class DCI(val dri: Set<DRI>, val kind: Kind) { interface ContentNode : WithExtraProperties<ContentNode> { val dci: DCI - val platforms: Set<PlatformData> + val sourceSets: Set<SourceSetData> val style: Set<Style> } @@ -18,7 +19,7 @@ interface ContentNode : WithExtraProperties<ContentNode> { data class ContentText( val text: String, override val dci: DCI, - override val platforms: Set<PlatformData>, + override val sourceSets: Set<SourceSetData>, override val style: Set<Style> = emptySet(), override val extra: PropertyContainer<ContentNode> = PropertyContainer.empty() ) : ContentNode { @@ -27,7 +28,7 @@ data class ContentText( // TODO: Remove data class ContentBreakLine( - override val platforms: Set<PlatformData>, + override val sourceSets: Set<SourceSetData>, override val dci: DCI = DCI(emptySet(), ContentKind.Empty), override val style: Set<Style> = emptySet(), override val extra: PropertyContainer<ContentNode> = PropertyContainer.empty() @@ -40,11 +41,11 @@ data class ContentHeader( override val children: List<ContentNode>, val level: Int, override val dci: DCI, - override val platforms: Set<PlatformData>, + override val sourceSets: Set<SourceSetData>, override val style: Set<Style>, override val extra: PropertyContainer<ContentNode> = PropertyContainer.empty() ) : ContentComposite { - constructor(level: Int, c: ContentComposite) : this(c.children, level, c.dci, c.platforms, c.style, c.extra) + constructor(level: Int, c: ContentComposite) : this(c.children, level, c.dci, c.sourceSets, c.style, c.extra) override fun withNewExtras(newExtras: PropertyContainer<ContentNode>): ContentHeader = copy(extra = newExtras) } @@ -54,7 +55,7 @@ data class ContentCode( override val children: List<ContentNode>, val language: String, override val dci: DCI, - override val platforms: Set<PlatformData>, + override val sourceSets: Set<SourceSetData>, override val style: Set<Style>, override val extra: PropertyContainer<ContentNode> = PropertyContainer.empty() ) : ContentComposite { @@ -69,7 +70,7 @@ data class ContentDRILink( override val children: List<ContentNode>, val address: DRI, override val dci: DCI, - override val platforms: Set<PlatformData>, + override val sourceSets: Set<SourceSetData>, override val style: Set<Style> = emptySet(), override val extra: PropertyContainer<ContentNode> = PropertyContainer.empty() ) : ContentLink { @@ -81,7 +82,7 @@ data class ContentResolvedLink( override val children: List<ContentNode>, val address: String, override val dci: DCI, - override val platforms: Set<PlatformData>, + override val sourceSets: Set<SourceSetData>, override val style: Set<Style> = emptySet(), override val extra: PropertyContainer<ContentNode> = PropertyContainer.empty() ) : ContentLink { @@ -95,7 +96,7 @@ data class ContentEmbeddedResource( val address: String, val altText: String?, override val dci: DCI, - override val platforms: Set<PlatformData>, + override val sourceSets: Set<SourceSetData>, override val style: Set<Style> = emptySet(), override val extra: PropertyContainer<ContentNode> = PropertyContainer.empty() ) : ContentLink { @@ -113,7 +114,7 @@ data class ContentTable( val header: List<ContentGroup>, override val children: List<ContentGroup>, override val dci: DCI, - override val platforms: Set<PlatformData>, + override val sourceSets: Set<SourceSetData>, override val style: Set<Style>, override val extra: PropertyContainer<ContentNode> = PropertyContainer.empty() ) : ContentComposite { @@ -125,7 +126,7 @@ data class ContentList( override val children: List<ContentNode>, val ordered: Boolean, override val dci: DCI, - override val platforms: Set<PlatformData>, + override val sourceSets: Set<SourceSetData>, override val style: Set<Style>, override val extra: PropertyContainer<ContentNode> = PropertyContainer.empty() ) : ContentComposite { @@ -136,7 +137,7 @@ data class ContentList( data class ContentGroup( override val children: List<ContentNode>, override val dci: DCI, - override val platforms: Set<PlatformData>, + override val sourceSets: Set<SourceSetData>, override val style: Set<Style>, override val extra: PropertyContainer<ContentNode> = PropertyContainer.empty() ) : ContentComposite { @@ -145,7 +146,7 @@ data class ContentGroup( data class PlatformHintedContent( val inner: ContentNode, - override val platforms: Set<PlatformData> + override val sourceSets: Set<SourceSetData> ) : ContentComposite { override val children = listOf(inner) @@ -171,7 +172,7 @@ interface Kind enum class ContentKind : Kind { Comment, Constructors, Functions, Parameters, Properties, Classlikes, Packages, Symbol, Sample, Main, BriefComment, - Empty, Source, TypeAliases, Cover, Inheritors, PlatformDependantHint; + Empty, Source, TypeAliases, Cover, Inheritors, SourceSetDependantHint; companion object { private val platformTagged = diff --git a/core/src/main/kotlin/pages/PageNodes.kt b/core/src/main/kotlin/pages/PageNodes.kt index 244d951e..32b2846e 100644 --- a/core/src/main/kotlin/pages/PageNodes.kt +++ b/core/src/main/kotlin/pages/PageNodes.kt @@ -1,5 +1,6 @@ package org.jetbrains.dokka.pages +import org.jetbrains.dokka.DokkaConfiguration import org.jetbrains.dokka.model.Documentable import org.jetbrains.dokka.Platform import org.jetbrains.dokka.links.DRI @@ -151,10 +152,6 @@ class MemberPageNode( else MemberPageNode(name, content, dri, documentable, children, embeddedResources) } -data class PlatformData(val name: String, val platformType: Platform, val targets: List<String>) { - override fun toString() = targets.toString() -} - fun PageNode.dfs(predicate: (PageNode) -> Boolean): PageNode? = if (predicate(this)) { this } else { |