diff options
Diffstat (limited to 'plugins/base/src')
12 files changed, 94 insertions, 89 deletions
diff --git a/plugins/base/src/main/kotlin/renderers/DefaultRenderer.kt b/plugins/base/src/main/kotlin/renderers/DefaultRenderer.kt index afee1b33..84be6df0 100644 --- a/plugins/base/src/main/kotlin/renderers/DefaultRenderer.kt +++ b/plugins/base/src/main/kotlin/renderers/DefaultRenderer.kt @@ -4,7 +4,6 @@ import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.coroutineScope import kotlinx.coroutines.launch import kotlinx.coroutines.runBlocking -import org.jetbrains.dokka.DokkaConfiguration.DokkaSourceSet import org.jetbrains.dokka.base.DokkaBase import org.jetbrains.dokka.base.resolvers.local.LocationProvider import org.jetbrains.dokka.pages.* @@ -30,7 +29,7 @@ abstract class DefaultRenderer<T>( abstract fun T.buildList( node: ContentList, pageContext: ContentPage, - sourceSetRestriction: Set<DokkaSourceSet>? = null + sourceSetRestriction: Set<ContentSourceSet>? = null ) abstract fun T.buildNewLine() @@ -38,7 +37,7 @@ abstract class DefaultRenderer<T>( abstract fun T.buildTable( node: ContentTable, pageContext: ContentPage, - sourceSetRestriction: Set<DokkaSourceSet>? = null + sourceSetRestriction: Set<ContentSourceSet>? = null ) abstract fun T.buildText(textNode: ContentText) @@ -50,13 +49,13 @@ abstract class DefaultRenderer<T>( open fun T.buildPlatformDependent( content: PlatformHintedContent, pageContext: ContentPage, - sourceSetRestriction: Set<DokkaSourceSet>? + sourceSetRestriction: Set<ContentSourceSet>? ) = buildContentNode(content.inner, pageContext) open fun T.buildGroup( node: ContentGroup, pageContext: ContentPage, - sourceSetRestriction: Set<DokkaSourceSet>? = null + sourceSetRestriction: Set<ContentSourceSet>? = null ) = wrapGroup(node, pageContext) { node.children.forEach { it.build(this, pageContext, sourceSetRestriction) } } @@ -69,7 +68,7 @@ abstract class DefaultRenderer<T>( open fun T.buildLinkText( nodes: List<ContentNode>, pageContext: ContentPage, - sourceSetRestriction: Set<DokkaSourceSet>? = null + sourceSetRestriction: Set<ContentSourceSet>? = null ) { nodes.forEach { it.build(this, pageContext, sourceSetRestriction) } } @@ -85,7 +84,7 @@ abstract class DefaultRenderer<T>( open fun T.buildHeader( node: ContentHeader, pageContext: ContentPage, - sourceSetRestriction: Set<DokkaSourceSet>? = null + sourceSetRestriction: Set<ContentSourceSet>? = null ) { buildHeader(node.level, node) { node.children.forEach { it.build(this, pageContext, sourceSetRestriction) } } } @@ -93,14 +92,14 @@ abstract class DefaultRenderer<T>( open fun ContentNode.build( builder: T, pageContext: ContentPage, - sourceSetRestriction: Set<DokkaSourceSet>? = null + sourceSetRestriction: Set<ContentSourceSet>? = null ) = builder.buildContentNode(this, pageContext, sourceSetRestriction) open fun T.buildContentNode( node: ContentNode, pageContext: ContentPage, - sourceSetRestriction: Set<DokkaSourceSet>? = null + sourceSetRestriction: Set<ContentSourceSet>? = null ) { if (sourceSetRestriction == null || node.sourceSets.any { it in sourceSetRestriction }) { when (node) { @@ -178,8 +177,8 @@ abstract class DefaultRenderer<T>( protected fun ContentDivergentGroup.groupDivergentInstances( pageContext: ContentPage, - beforeTransformer: (ContentDivergentInstance, ContentPage, DokkaSourceSet) -> String, - afterTransformer: (ContentDivergentInstance, ContentPage, DokkaSourceSet) -> String + beforeTransformer: (ContentDivergentInstance, ContentPage, ContentSourceSet) -> String, + afterTransformer: (ContentDivergentInstance, ContentPage, ContentSourceSet) -> String ): Map<SerializedBeforeAndAfter, List<InstanceWithSource>> = children.flatMap { instance -> instance.sourceSets.map { sourceSet -> @@ -195,6 +194,6 @@ abstract class DefaultRenderer<T>( } internal typealias SerializedBeforeAndAfter = Pair<String, String> -internal typealias InstanceWithSource = Pair<ContentDivergentInstance, DokkaSourceSet> +internal typealias InstanceWithSource = Pair<ContentDivergentInstance, ContentSourceSet> -fun ContentPage.sourceSets() = this.content.sourceSets
\ No newline at end of file +fun ContentPage.sourceSets() = this.content.sourceSets diff --git a/plugins/base/src/main/kotlin/renderers/html/HtmlRenderer.kt b/plugins/base/src/main/kotlin/renderers/html/HtmlRenderer.kt index 88d2539d..c533836a 100644 --- a/plugins/base/src/main/kotlin/renderers/html/HtmlRenderer.kt +++ b/plugins/base/src/main/kotlin/renderers/html/HtmlRenderer.kt @@ -5,7 +5,6 @@ import kotlinx.coroutines.launch import kotlinx.coroutines.runBlocking import kotlinx.html.* import kotlinx.html.stream.createHTML -import org.jetbrains.dokka.DokkaConfiguration.DokkaSourceSet import org.jetbrains.dokka.Platform import org.jetbrains.dokka.base.DokkaBase import org.jetbrains.dokka.base.renderers.DefaultRenderer @@ -111,7 +110,7 @@ open class HtmlRenderer( page.content.withDescendants().flatMap { it.sourceSets }.distinct().forEach { button(classes = "platform-tag platform-selector") { attributes["data-active"] = "" - attributes["data-filter"] = it.sourceSetID.toString() + attributes["data-filter"] = it.sourceSetIDs.merged.toString() when (it.analysisPlatform.key) { "common" -> classes = classes + "common-like" "native" -> classes = classes + "native-like" @@ -157,7 +156,7 @@ open class HtmlRenderer( override fun FlowContent.buildPlatformDependent( content: PlatformHintedContent, pageContext: ContentPage, - sourceSetRestriction: Set<DokkaSourceSet>? + sourceSetRestriction: Set<ContentSourceSet>? ) = buildPlatformDependent( content.sourceSets.filter { @@ -169,7 +168,7 @@ open class HtmlRenderer( ) private fun FlowContent.buildPlatformDependent( - nodes: Map<DokkaSourceSet, Collection<ContentNode>>, + nodes: Map<ContentSourceSet, Collection<ContentNode>>, pageContext: ContentPage, extra: PropertyContainer<ContentNode> = PropertyContainer.empty(), styles: Set<Style> = emptySet() @@ -186,17 +185,17 @@ open class HtmlRenderer( attributes["data-toggle-list"] = "data-toggle-list" contents.forEachIndexed { index, pair -> button(classes = "platform-bookmark") { - attributes["data-filterable-current"] = pair.first.sourceSetID.toString() - attributes["data-filterable-set"] = pair.first.sourceSetID.toString() + attributes["data-filterable-current"] = pair.first.sourceSetIDs.merged.toString() + attributes["data-filterable-set"] = pair.first.sourceSetIDs.merged.toString() if (index == 0) attributes["data-active"] = "" - attributes["data-toggle"] = pair.first.sourceSetID.toString() + attributes["data-toggle"] = pair.first.sourceSetIDs.merged.toString() when (pair.first.analysisPlatform.key) { "common" -> classes = classes + "common-like" "native" -> classes = classes + "native-like" "jvm" -> classes = classes + "jvm-like" "js" -> classes = classes + "js-like" } - attributes["data-toggle"] = pair.first.sourceSetID.toString() + attributes["data-toggle"] = pair.first.sourceSetIDs.merged.toString() text(pair.first.displayName) } } @@ -209,9 +208,9 @@ open class HtmlRenderer( } private fun contentsForSourceSetDependent( - nodes: Map<DokkaSourceSet, Collection<ContentNode>>, + nodes: Map<ContentSourceSet, Collection<ContentNode>>, pageContext: ContentPage, - ): List<Pair<DokkaSourceSet, String>> { + ): List<Pair<ContentSourceSet, String>> { var counter = 0 return nodes.toList().map { (sourceSet, elements) -> sourceSet to createHTML(prettyPrint = false).div { @@ -220,15 +219,15 @@ open class HtmlRenderer( } }.stripDiv() }.groupBy( - Pair<DokkaSourceSet, String>::second, - Pair<DokkaSourceSet, String>::first + Pair<ContentSourceSet, String>::second, + Pair<ContentSourceSet, String>::first ).entries.flatMap { (html, sourceSets) -> sourceSets.filterNot { sourceSetDependencyMap[it].orEmpty().any { dependency -> sourceSets.contains(dependency) } }.map { it to createHTML(prettyPrint = false).div(classes = "content sourceset-depenent-content") { if (counter++ == 0) attributes["data-active"] = "" - attributes["data-togglable"] = it.sourceSetID.toString() + attributes["data-togglable"] = it.sourceSetIDs.merged.toString() unsafe { +html } @@ -260,10 +259,10 @@ open class HtmlRenderer( consumer.onTagContentUnsafe { +createHTML().div("divergent-group") { attributes["data-filterable-current"] = groupedDivergent.keys.joinToString(" ") { - it.sourceSetID.toString() + it.sourceSetIDs.merged.toString() } attributes["data-filterable-set"] = groupedDivergent.keys.joinToString(" ") { - it.sourceSetID.toString() + it.sourceSetIDs.merged.toString() } val divergentForPlatformDependent = groupedDivergent.map { (sourceSet, elements) -> @@ -309,14 +308,14 @@ open class HtmlRenderer( override fun FlowContent.buildList( node: ContentList, pageContext: ContentPage, - sourceSetRestriction: Set<DokkaSourceSet>? + sourceSetRestriction: Set<ContentSourceSet>? ) = if (node.ordered) ol { buildListItems(node.children, pageContext, sourceSetRestriction) } else ul { buildListItems(node.children, pageContext, sourceSetRestriction) } open fun OL.buildListItems( items: List<ContentNode>, pageContext: ContentPage, - sourceSetRestriction: Set<DokkaSourceSet>? = null + sourceSetRestriction: Set<ContentSourceSet>? = null ) { items.forEach { if (it is ContentList) @@ -329,7 +328,7 @@ open class HtmlRenderer( open fun UL.buildListItems( items: List<ContentNode>, pageContext: ContentPage, - sourceSetRestriction: Set<DokkaSourceSet>? = null + sourceSetRestriction: Set<ContentSourceSet>? = null ) { items.forEach { if (it is ContentList) @@ -356,7 +355,7 @@ open class HtmlRenderer( private fun FlowContent.buildRow( node: ContentGroup, pageContext: ContentPage, - sourceSetRestriction: Set<DokkaSourceSet>?, + sourceSetRestriction: Set<ContentSourceSet>?, style: Set<Style> ) { node.children @@ -368,10 +367,10 @@ open class HtmlRenderer( div(classes = "table-row") { if (!style.contains(MultimoduleTable)) { attributes["data-filterable-current"] = node.sourceSets.joinToString(" ") { - it.sourceSetID.toString() + it.sourceSetIDs.merged.toString() } attributes["data-filterable-set"] = node.sourceSets.joinToString(" ") { - it.sourceSetID.toString() + it.sourceSetIDs.merged.toString() } } @@ -409,7 +408,7 @@ open class HtmlRenderer( } } - private fun FlowContent.createPlatformTagBubbles(sourceSets: List<DokkaSourceSet>) { + private fun FlowContent.createPlatformTagBubbles(sourceSets: List<ContentSourceSet>) { if (isMultiplatform) { div("platform-tags") { sourceSets.forEach { @@ -427,7 +426,10 @@ open class HtmlRenderer( } } - private fun FlowContent.createPlatformTags(node: ContentNode, sourceSetRestriction: Set<DokkaSourceSet>? = null) { + private fun FlowContent.createPlatformTags( + node: ContentNode, + sourceSetRestriction: Set<ContentSourceSet>? = null + ) { node.takeIf { sourceSetRestriction == null || it.sourceSets.any { s -> s in sourceSetRestriction } }?.let { createPlatformTagBubbles(node.sourceSets.filter { sourceSetRestriction == null || it in sourceSetRestriction @@ -438,7 +440,7 @@ open class HtmlRenderer( override fun FlowContent.buildTable( node: ContentTable, pageContext: ContentPage, - sourceSetRestriction: Set<DokkaSourceSet>? + sourceSetRestriction: Set<ContentSourceSet>? ) { when (node.dci.kind) { ContentKind.Comment -> buildDefaultTable(node, pageContext, sourceSetRestriction) @@ -455,7 +457,7 @@ open class HtmlRenderer( fun FlowContent.buildDefaultTable( node: ContentTable, pageContext: ContentPage, - sourceSetRestriction: Set<DokkaSourceSet>? + sourceSetRestriction: Set<ContentSourceSet>? ) { table { thead { @@ -540,7 +542,7 @@ open class HtmlRenderer( fun FlowContent.buildLink( to: DRI, - platforms: List<DokkaSourceSet>, + platforms: List<ContentSourceSet>, from: PageNode? = null, block: FlowContent.() -> Unit ) = buildLink(locationProvider.resolve(to, platforms.toSet(), from), block) @@ -580,7 +582,7 @@ open class HtmlRenderer( private fun getSymbolSignature(page: ContentPage) = page.content.dfs { it.dci.kind == ContentKind.Symbol } private fun flattenToText(node: ContentNode): String { - fun getContentTextNodes(node: ContentNode, sourceSetRestriction: DokkaSourceSet): List<ContentText> = + fun getContentTextNodes(node: ContentNode, sourceSetRestriction: ContentSourceSet): List<ContentText> = when (node) { is ContentText -> listOf(node) is ContentComposite -> node.children @@ -723,7 +725,7 @@ open class HtmlRenderer( span { text("© 2020 Copyright") } span("pull-right") { span { text("Sponsored and developed by dokka") } - a(href= "https://github.com/Kotlin/dokka") { + a(href = "https://github.com/Kotlin/dokka") { span(classes = "padded-icon") { unsafe { raw( diff --git a/plugins/base/src/main/kotlin/renderers/html/NavigationPage.kt b/plugins/base/src/main/kotlin/renderers/html/NavigationPage.kt index 46295d71..138a8e16 100644 --- a/plugins/base/src/main/kotlin/renderers/html/NavigationPage.kt +++ b/plugins/base/src/main/kotlin/renderers/html/NavigationPage.kt @@ -3,7 +3,7 @@ package org.jetbrains.dokka.base.renderers.html import kotlinx.html.* import kotlinx.html.stream.createHTML import org.jetbrains.dokka.links.DRI -import org.jetbrains.dokka.DokkaConfiguration.DokkaSourceSet +import org.jetbrains.dokka.pages.ContentSourceSet import org.jetbrains.dokka.pages.PageNode import org.jetbrains.dokka.pages.RendererSpecificPage import org.jetbrains.dokka.pages.RenderingStrategy @@ -41,7 +41,7 @@ class NavigationPage(val root: NavigationNode) : RendererSpecificPage { class NavigationNode( val name: String, val dri: DRI, - val sourceSets: Set<DokkaSourceSet>, + val sourceSets: Set<ContentSourceSet>, val children: List<NavigationNode> ) diff --git a/plugins/base/src/main/kotlin/resolvers/local/BaseLocationProvider.kt b/plugins/base/src/main/kotlin/resolvers/local/BaseLocationProvider.kt index 4204006e..a9a5e498 100644 --- a/plugins/base/src/main/kotlin/resolvers/local/BaseLocationProvider.kt +++ b/plugins/base/src/main/kotlin/resolvers/local/BaseLocationProvider.kt @@ -1,9 +1,10 @@ package org.jetbrains.dokka.base.resolvers.local import org.jetbrains.dokka.DokkaConfiguration -import org.jetbrains.dokka.DokkaConfiguration.DokkaSourceSet import org.jetbrains.dokka.base.DokkaBase import org.jetbrains.dokka.links.DRI +import org.jetbrains.dokka.pages.ContentSourceSet +import org.jetbrains.dokka.pages.sourceSetIDs import org.jetbrains.dokka.plugability.DokkaContext import org.jetbrains.dokka.plugability.plugin import org.jetbrains.dokka.plugability.query @@ -23,12 +24,10 @@ abstract class BaseLocationProvider(protected val dokkaContext: DokkaContext) : protected fun getExternalLocation( dri: DRI, - sourceSets: Set<DokkaSourceSet> + sourceSets: Set<ContentSourceSet> ): String { val jdkToExternalDocumentationLinks = dokkaContext.configuration.sourceSets - .filter { sourceSet -> - sourceSets.contains(sourceSet) - } + .filter { sourceSet -> sourceSet.sourceSetID in sourceSets.sourceSetIDs } .groupBy({ it.jdkVersion }, { it.externalDocumentationLinks }) .map { it.key to it.value.flatten().distinct() }.toMap() diff --git a/plugins/base/src/main/kotlin/resolvers/local/DefaultLocationProvider.kt b/plugins/base/src/main/kotlin/resolvers/local/DefaultLocationProvider.kt index 1df0a700..0021b7fb 100644 --- a/plugins/base/src/main/kotlin/resolvers/local/DefaultLocationProvider.kt +++ b/plugins/base/src/main/kotlin/resolvers/local/DefaultLocationProvider.kt @@ -1,7 +1,6 @@ package org.jetbrains.dokka.base.resolvers.local import org.jetbrains.dokka.DokkaConfiguration -import org.jetbrains.dokka.DokkaConfiguration.DokkaSourceSet import org.jetbrains.dokka.base.resolvers.anchors.SymbolAnchorHint import org.jetbrains.dokka.base.resolvers.external.ExternalLocationProvider import org.jetbrains.dokka.links.DRI @@ -51,7 +50,7 @@ open class DefaultLocationProvider( override fun resolve(node: PageNode, context: PageNode?, skipExtension: Boolean): String = pathTo(node, context) + if (!skipExtension) extension else "" - override fun resolve(dri: DRI, sourceSets: Set<DokkaSourceSet>, context: PageNode?): String = + override fun resolve(dri: DRI, sourceSets: Set<ContentSourceSet>, context: PageNode?): String = pagesIndex[dri]?.let { resolve(it, context) } ?: anchorsIndex[dri]?.let { resolve(it, context) + "#$dri" } // Not found in PageGraph, that means it's an external link diff --git a/plugins/base/src/main/kotlin/resolvers/local/LocationProvider.kt b/plugins/base/src/main/kotlin/resolvers/local/LocationProvider.kt index 745636d0..bf5d9be4 100644 --- a/plugins/base/src/main/kotlin/resolvers/local/LocationProvider.kt +++ b/plugins/base/src/main/kotlin/resolvers/local/LocationProvider.kt @@ -1,12 +1,12 @@ package org.jetbrains.dokka.base.resolvers.local import org.jetbrains.dokka.links.DRI -import org.jetbrains.dokka.DokkaConfiguration.DokkaSourceSet +import org.jetbrains.dokka.pages.ContentSourceSet import org.jetbrains.dokka.pages.PageNode import org.jetbrains.dokka.pages.RootPageNode interface LocationProvider { - fun resolve(dri: DRI, sourceSets: Set<DokkaSourceSet>, context: PageNode? = null): String + fun resolve(dri: DRI, sourceSets: Set<ContentSourceSet>, context: PageNode? = null): String fun resolve(node: PageNode, context: PageNode? = null, skipExtension: Boolean = false): String fun resolveRoot(node: PageNode): String fun ancestors(node: PageNode): List<PageNode> diff --git a/plugins/base/src/main/kotlin/resolvers/local/MultimoduleLocationProvider.kt b/plugins/base/src/main/kotlin/resolvers/local/MultimoduleLocationProvider.kt index 54aded35..c5e16cc3 100644 --- a/plugins/base/src/main/kotlin/resolvers/local/MultimoduleLocationProvider.kt +++ b/plugins/base/src/main/kotlin/resolvers/local/MultimoduleLocationProvider.kt @@ -1,7 +1,7 @@ package org.jetbrains.dokka.base.resolvers.local import org.jetbrains.dokka.links.DRI -import org.jetbrains.dokka.DokkaConfiguration.DokkaSourceSet +import org.jetbrains.dokka.pages.ContentSourceSet import org.jetbrains.dokka.pages.PageNode import org.jetbrains.dokka.pages.RootPageNode import org.jetbrains.dokka.plugability.DokkaContext @@ -14,7 +14,7 @@ class MultimoduleLocationProvider(private val root: RootPageNode, context: Dokka it.name to it.path }.toMap() - override fun resolve(dri: DRI, sourceSets: Set<DokkaSourceSet>, context: PageNode?): String = + override fun resolve(dri: DRI, sourceSets: Set<ContentSourceSet>, context: PageNode?): String = dri.takeIf { it.packageName == MULTIMODULE_PACKAGE_PLACEHOLDER }?.classNames?.let { paths[it] }?.let { "$it/${identifierToFilename(dri.classNames.orEmpty())}/index.html" } ?: defaultLocationProvider.resolve(dri, sourceSets, context) 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 9d667623..3d9a9993 100644 --- a/plugins/base/src/main/kotlin/transformers/pages/comments/DocTagToContentConverter.kt +++ b/plugins/base/src/main/kotlin/transformers/pages/comments/DocTagToContentConverter.kt @@ -30,7 +30,7 @@ object DocTagToContentConverter : CommentsToContentConverter { buildChildren(docTag), level, dci, - sourceSets, + sourceSets.toContentSourceSets(), styles ) ) @@ -41,7 +41,7 @@ object DocTagToContentConverter : CommentsToContentConverter { buildChildren(docTag), ordered, dci, - sourceSets, + sourceSets.toContentSourceSets(), styles, ((PropertyContainer.empty<ContentNode>()) + SimpleAttr("start", start.toString())) ) @@ -49,7 +49,7 @@ object DocTagToContentConverter : CommentsToContentConverter { fun buildNewLine() = listOf( ContentBreakLine( - sourceSets + sourceSets.toContentSourceSets() ) ) @@ -66,20 +66,26 @@ object DocTagToContentConverter : CommentsToContentConverter { is Ul -> buildList(false) is Ol -> buildList(true, docTag.params["start"]?.toInt() ?: 1) is Li -> listOf( - ContentGroup(buildChildren(docTag), dci, sourceSets, styles, extra) + ContentGroup(buildChildren(docTag), dci, sourceSets.toContentSourceSets(), styles, extra) ) is Br -> buildNewLine() is B -> buildChildren(docTag, setOf(TextStyle.Strong)) is I -> buildChildren(docTag, setOf(TextStyle.Italic)) is P -> listOf( - ContentGroup(buildChildren(docTag.collapseParagraphs()), dci, sourceSets, styles + setOf(TextStyle.Paragraph), extra) + ContentGroup( + buildChildren(docTag.collapseParagraphs()), + dci, + sourceSets.toContentSourceSets(), + styles + setOf(TextStyle.Paragraph), + extra + ) ) is A -> listOf( ContentResolvedLink( buildChildren(docTag), - docTag.params.get("href")!!, + docTag.params.getValue("href"), dci, - sourceSets, + sourceSets.toContentSourceSets(), styles ) ) @@ -91,7 +97,7 @@ object DocTagToContentConverter : CommentsToContentConverter { setOf(docTag.dri), ContentKind.Main ), - sourceSets, + sourceSets.toContentSourceSets(), styles ) ) @@ -100,7 +106,7 @@ object DocTagToContentConverter : CommentsToContentConverter { buildChildren(docTag), "", dci, - sourceSets, + sourceSets.toContentSourceSets(), styles ) ) @@ -109,7 +115,7 @@ object DocTagToContentConverter : CommentsToContentConverter { buildChildren(docTag), "", dci, - sourceSets, + sourceSets.toContentSourceSets(), styles ) ) @@ -118,7 +124,7 @@ object DocTagToContentConverter : CommentsToContentConverter { buildChildren(docTag), "", dci, - sourceSets, + sourceSets.toContentSourceSets(), styles ) ) @@ -127,7 +133,7 @@ object DocTagToContentConverter : CommentsToContentConverter { address = docTag.params["href"]!!, altText = docTag.params["alt"], dci = dci, - sourceSets = sourceSets, + sourceSets = sourceSets.toContentSourceSets(), style = styles, extra = extra ) @@ -136,7 +142,7 @@ object DocTagToContentConverter : CommentsToContentConverter { ContentText( "", dci, - sourceSets, + sourceSets.toContentSourceSets(), setOf() ) ) @@ -144,7 +150,7 @@ object DocTagToContentConverter : CommentsToContentConverter { ContentText( docTag.body, dci, - sourceSets, + sourceSets.toContentSourceSets(), styles ) ) @@ -154,7 +160,7 @@ object DocTagToContentConverter : CommentsToContentConverter { buildTableRows(docTag.children.filterIsInstance<Th>(), CommentTable), buildTableRows(docTag.children.filterIsInstance<Tr>(), CommentTable), dci, - sourceSets, + sourceSets.toContentSourceSets(), styles + CommentTable ) ) @@ -162,10 +168,10 @@ object DocTagToContentConverter : CommentsToContentConverter { is Tr -> listOf( ContentGroup( docTag.children.map { - ContentGroup(buildChildren(it), dci, sourceSets, styles, extra) + ContentGroup(buildChildren(it), dci, sourceSets.toContentSourceSets(), styles, extra) }, dci, - sourceSets, + sourceSets.toContentSourceSets(), styles ) ) @@ -173,7 +179,7 @@ object DocTagToContentConverter : CommentsToContentConverter { ContentGroup( buildChildren(docTag, newStyles = styles + ContentStyle.InDocumentationAnchor), dci, - sourceSets, + sourceSets.toContentSourceSets(), styles ) ) diff --git a/plugins/base/src/main/kotlin/transformers/pages/samples/SamplesTransformer.kt b/plugins/base/src/main/kotlin/transformers/pages/samples/SamplesTransformer.kt index f13e52ab..1eecb114 100644 --- a/plugins/base/src/main/kotlin/transformers/pages/samples/SamplesTransformer.kt +++ b/plugins/base/src/main/kotlin/transformers/pages/samples/SamplesTransformer.kt @@ -125,7 +125,7 @@ abstract class SamplesTransformer(val context: DokkaContext) : PageTransformer { } private fun contentCode( - sourceSets: Set<DokkaSourceSet>, + sourceSets: Set<ContentSourceSet>, dri: Set<DRI>, content: String, language: String, diff --git a/plugins/base/src/main/kotlin/transformers/pages/sourcelinks/SourceLinksTransformer.kt b/plugins/base/src/main/kotlin/transformers/pages/sourcelinks/SourceLinksTransformer.kt index da2859d9..0488f4e0 100644 --- a/plugins/base/src/main/kotlin/transformers/pages/sourcelinks/SourceLinksTransformer.kt +++ b/plugins/base/src/main/kotlin/transformers/pages/sourcelinks/SourceLinksTransformer.kt @@ -66,7 +66,7 @@ class SourceLinksTransformer(val context: DokkaContext, val builder: PageContent } }, DCI(node.dri, ContentKind.Source), - node.documentable!!.sourceSets.toSet(), + node.documentable!!.sourceSets.toContentSourceSets(), style = emptySet(), extra = mainExtra + SimpleAttr.header("Sources") ) diff --git a/plugins/base/src/main/kotlin/translators/documentables/DefaultPageCreator.kt b/plugins/base/src/main/kotlin/translators/documentables/DefaultPageCreator.kt index 02f4b54e..04b29990 100644 --- a/plugins/base/src/main/kotlin/translators/documentables/DefaultPageCreator.kt +++ b/plugins/base/src/main/kotlin/translators/documentables/DefaultPageCreator.kt @@ -159,7 +159,7 @@ open class DefaultPageCreator( } }, DCI(setOf(dri), ContentKind.Inheritors), - sourceSets.toSet(), + sourceSets.toContentSourceSets(), style = emptySet(), extra = mainExtra + SimpleAttr.header("Inheritors") ) diff --git a/plugins/base/src/main/kotlin/translators/documentables/PageContentBuilder.kt b/plugins/base/src/main/kotlin/translators/documentables/PageContentBuilder.kt index b7927076..a556a96e 100644 --- a/plugins/base/src/main/kotlin/translators/documentables/PageContentBuilder.kt +++ b/plugins/base/src/main/kotlin/translators/documentables/PageContentBuilder.kt @@ -73,7 +73,7 @@ open class PageContentBuilder( ) = ContentGroup( contents.toList(), DCI(mainDRI, kind), - sourceSets, + sourceSets.toContentSourceSets(), styles, extra ) @@ -88,10 +88,10 @@ open class PageContentBuilder( private val defaultHeaders get() = listOf( - contentFor(mainDRI, mainSourcesetData){ + contentFor(mainDRI, mainSourcesetData) { text("Name") }, - contentFor(mainDRI, mainSourcesetData){ + contentFor(mainDRI, mainSourcesetData) { text("Summary") } ) @@ -153,7 +153,7 @@ open class PageContentBuilder( defaultHeaders, operation(), DCI(mainDRI, kind), - sourceSets, styles, extra + sourceSets.toContentSourceSets(), styles, extra ) } @@ -188,7 +188,7 @@ open class PageContentBuilder( } }, DCI(mainDRI, kind), - sourceSets, styles, extra + sourceSets.toContentSourceSets(), styles, extra ) } } @@ -234,7 +234,7 @@ open class PageContentBuilder( listOf(createText(text, kind, sourceSets, styles, extra)), address, DCI(mainDRI, kind), - sourceSets + sourceSets.toContentSourceSets() ) fun link( @@ -250,7 +250,7 @@ open class PageContentBuilder( address = address, extra = PropertyContainer.empty(), dci = DCI(mainDRI, kind), - sourceSets = sourceSets, + sourceSets = sourceSets.toContentSourceSets(), style = emptySet() ) } @@ -267,7 +267,7 @@ open class PageContentBuilder( contentFor(mainDRI, sourceSets, kind, styles, extra, block).children, address, DCI(mainDRI, kind), - sourceSets + sourceSets.toContentSourceSets() ) } @@ -283,7 +283,7 @@ open class PageContentBuilder( DCI(mainDRI, kind), sourceSets ) - contents += ContentGroup(content, DCI(mainDRI, kind), sourceSets, styles, extra) + contents += ContentGroup(content, DCI(mainDRI, kind), sourceSets.toContentSourceSets(), styles, extra) } fun group( @@ -331,7 +331,7 @@ open class PageContentBuilder( ) { contents += PlatformHintedContent( buildGroup(dri, sourceSets, kind, styles, extra, block), - sourceSets + sourceSets.toContentSourceSets() ) } @@ -345,7 +345,7 @@ open class PageContentBuilder( ) { contents += PlatformHintedContent( buildGroup(setOf(dri), sourcesetData, kind, styles, extra, block), - sourcesetData + sourcesetData.toContentSourceSets() ) } @@ -356,7 +356,7 @@ open class PageContentBuilder( styles: Set<Style>, extra: PropertyContainer<ContentNode> ) = - ContentText(text, DCI(mainDRI, kind), sourceSets, styles, extra) + ContentText(text, DCI(mainDRI, kind), sourceSets.toContentSourceSets(), styles, extra) fun <T> sourceSetDependentText( value: SourceSetDependent<T>, @@ -466,9 +466,9 @@ open class PageContentBuilder( divergent ?: throw IllegalStateException("Divergent block needs divergent part"), after, DCI(mainDRI, kind), - sourceSets, + sourceSets.toContentSourceSets(), styles, extra ) } -}
\ No newline at end of file +} |