diff options
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 ) ) |