diff options
author | Błażej Kardyś <bkardys@virtuslab.com> | 2020-05-05 17:45:12 +0200 |
---|---|---|
committer | Paweł Marks <Kordyjan@users.noreply.github.com> | 2020-05-14 13:30:33 +0200 |
commit | 3f2a790190da4f40ea6d8a976aa1929b2a1b002b (patch) | |
tree | 752ee84451954e9ea5e6d4133e18e41aaee2f7b1 /plugins/base/src/main/kotlin/transformers/pages/comments | |
parent | a440f0cb8756019131a2c15389e747aea3c585e7 (diff) | |
download | dokka-3f2a790190da4f40ea6d8a976aa1929b2a1b002b.tar.gz dokka-3f2a790190da4f40ea6d8a976aa1929b2a1b002b.tar.bz2 dokka-3f2a790190da4f40ea6d8a976aa1929b2a1b002b.zip |
Changing approach from platform-driven to source-set-driven
Diffstat (limited to 'plugins/base/src/main/kotlin/transformers/pages/comments')
-rw-r--r-- | plugins/base/src/main/kotlin/transformers/pages/comments/CommentsToContentConverter.kt | 3 | ||||
-rw-r--r-- | plugins/base/src/main/kotlin/transformers/pages/comments/DocTagToContentConverter.kt | 33 |
2 files changed, 19 insertions, 17 deletions
diff --git a/plugins/base/src/main/kotlin/transformers/pages/comments/CommentsToContentConverter.kt b/plugins/base/src/main/kotlin/transformers/pages/comments/CommentsToContentConverter.kt index 778e0498..cb74441e 100644 --- a/plugins/base/src/main/kotlin/transformers/pages/comments/CommentsToContentConverter.kt +++ b/plugins/base/src/main/kotlin/transformers/pages/comments/CommentsToContentConverter.kt @@ -1,5 +1,6 @@ package org.jetbrains.dokka.base.transformers.pages.comments +import org.jetbrains.dokka.model.SourceSetData import org.jetbrains.dokka.model.doc.DocTag import org.jetbrains.dokka.model.properties.PropertyContainer import org.jetbrains.dokka.pages.* @@ -8,7 +9,7 @@ interface CommentsToContentConverter { fun buildContent( docTag: DocTag, dci: DCI, - platforms: Set<PlatformData>, + platforms: Set<SourceSetData>, styles: Set<Style> = emptySet(), extras: PropertyContainer<ContentNode> = PropertyContainer.empty() ): List<ContentNode> diff --git a/plugins/base/src/main/kotlin/transformers/pages/comments/DocTagToContentConverter.kt b/plugins/base/src/main/kotlin/transformers/pages/comments/DocTagToContentConverter.kt index 4e65bae9..85391549 100644 --- a/plugins/base/src/main/kotlin/transformers/pages/comments/DocTagToContentConverter.kt +++ b/plugins/base/src/main/kotlin/transformers/pages/comments/DocTagToContentConverter.kt @@ -1,5 +1,6 @@ package org.jetbrains.dokka.base.transformers.pages.comments +import org.jetbrains.dokka.model.SourceSetData import org.jetbrains.dokka.model.doc.* import org.jetbrains.dokka.model.properties.PropertyContainer import org.jetbrains.dokka.pages.* @@ -8,19 +9,19 @@ object DocTagToContentConverter : CommentsToContentConverter { override fun buildContent( docTag: DocTag, dci: DCI, - platforms: Set<PlatformData>, + sourceSets: Set<SourceSetData>, styles: Set<Style>, extra: PropertyContainer<ContentNode> ): List<ContentNode> { fun buildChildren(docTag: DocTag, newStyles: Set<Style> = emptySet(), newExtras: SimpleAttr? = null) = docTag.children.flatMap { - buildContent(it, dci, platforms, styles + newStyles, newExtras?.let { extra + it } ?: extra) + buildContent(it, dci, sourceSets, styles + newStyles, newExtras?.let { extra + it } ?: extra) } fun buildTableRows(rows: List<DocTag>, newStyle: Style): List<ContentGroup> = rows.flatMap { - buildContent(it, dci, platforms, styles + newStyle, extra) as List<ContentGroup> + buildContent(it, dci, sourceSets, styles + newStyle, extra) as List<ContentGroup> } fun buildHeader(level: Int) = @@ -29,7 +30,7 @@ object DocTagToContentConverter : CommentsToContentConverter { buildChildren(docTag), level, dci, - platforms, + sourceSets, styles ) ) @@ -40,7 +41,7 @@ object DocTagToContentConverter : CommentsToContentConverter { buildChildren(docTag), ordered, dci, - platforms, + sourceSets, styles, ((PropertyContainer.empty<ContentNode>()) + SimpleAttr("start", start.toString())) ) @@ -48,7 +49,7 @@ object DocTagToContentConverter : CommentsToContentConverter { fun buildNewLine() = listOf( ContentBreakLine( - platforms + sourceSets ) ) @@ -71,7 +72,7 @@ object DocTagToContentConverter : CommentsToContentConverter { buildChildren(docTag), docTag.params.get("href")!!, dci, - platforms, + sourceSets, styles ) ) @@ -83,7 +84,7 @@ object DocTagToContentConverter : CommentsToContentConverter { setOf(docTag.dri), ContentKind.Symbol ), - platforms, + sourceSets, styles ) ) @@ -92,7 +93,7 @@ object DocTagToContentConverter : CommentsToContentConverter { buildChildren(docTag), "", dci, - platforms, + sourceSets, styles ) ) @@ -101,7 +102,7 @@ object DocTagToContentConverter : CommentsToContentConverter { buildChildren(docTag), "", dci, - platforms, + sourceSets, styles ) ) @@ -110,7 +111,7 @@ object DocTagToContentConverter : CommentsToContentConverter { address = docTag.params["href"]!!, altText = docTag.params["alt"], dci = dci, - platforms = platforms, + sourceSets = sourceSets, style = styles, extra = extra ) @@ -119,7 +120,7 @@ object DocTagToContentConverter : CommentsToContentConverter { ContentText( "", dci, - platforms, + sourceSets, setOf() ) ) @@ -127,7 +128,7 @@ object DocTagToContentConverter : CommentsToContentConverter { ContentText( docTag.body, dci, - platforms, + sourceSets, styles ) ) @@ -137,7 +138,7 @@ object DocTagToContentConverter : CommentsToContentConverter { buildTableRows(docTag.children.filterIsInstance<Th>(), CommentTable), buildTableRows(docTag.children.filterIsInstance<Tr>(), CommentTable), dci, - platforms, + sourceSets, styles + CommentTable ) ) @@ -145,10 +146,10 @@ object DocTagToContentConverter : CommentsToContentConverter { is Tr -> listOf( ContentGroup( docTag.children.map { - ContentGroup(buildChildren(it), dci, platforms, styles, extra) + ContentGroup(buildChildren(it), dci, sourceSets, styles, extra) }, dci, - platforms, + sourceSets, styles ) ) |