diff options
author | Andrzej Ratajczak <andrzej.ratajczak98@gmail.com> | 2020-03-31 17:23:54 +0200 |
---|---|---|
committer | Paweł Marks <Kordyjan@users.noreply.github.com> | 2020-04-08 13:21:22 +0200 |
commit | 5013037c6bc555df2544f08ce25afd0307ee2cc1 (patch) | |
tree | 509f6940f343ea45731b4b547a64cc90377fb445 /plugins/base | |
parent | 7d04ecbfe48125dbcd5e682b2c37fc1f7341822f (diff) | |
download | dokka-5013037c6bc555df2544f08ce25afd0307ee2cc1.tar.gz dokka-5013037c6bc555df2544f08ce25afd0307ee2cc1.tar.bz2 dokka-5013037c6bc555df2544f08ce25afd0307ee2cc1.zip |
Fixes tests
Diffstat (limited to 'plugins/base')
3 files changed, 7 insertions, 9 deletions
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 7a93f0b9..6cb35e66 100644 --- a/plugins/base/src/main/kotlin/transformers/pages/sourcelinks/SourceLinksTransformer.kt +++ b/plugins/base/src/main/kotlin/transformers/pages/sourcelinks/SourceLinksTransformer.kt @@ -20,11 +20,9 @@ import org.jetbrains.kotlin.utils.addToStdlib.safeAs class SourceLinksTransformer(val context: DokkaContext) : PageTransformer { - private lateinit var sourceLinks: List<SourceLink> - override fun invoke(input: RootPageNode): RootPageNode { - sourceLinks = context.configuration.passesConfigurations + val sourceLinks = context.configuration.passesConfigurations .flatMap { it.sourceLinks.map { sl -> SourceLink(sl, it.platformData) } } return input.transformContentPagesTree { node -> diff --git a/plugins/base/src/main/kotlin/translators/documentables/DefaultPageCreator.kt b/plugins/base/src/main/kotlin/translators/documentables/DefaultPageCreator.kt index 87f47ac8..312c7a5a 100644 --- a/plugins/base/src/main/kotlin/translators/documentables/DefaultPageCreator.kt +++ b/plugins/base/src/main/kotlin/translators/documentables/DefaultPageCreator.kt @@ -7,9 +7,6 @@ import org.jetbrains.dokka.base.translators.documentables.PageContentBuilder.Doc import org.jetbrains.dokka.links.DRI import org.jetbrains.dokka.model.* import org.jetbrains.dokka.model.doc.* -import org.jetbrains.dokka.model.DFunction -import org.jetbrains.dokka.model.doc.Property -import org.jetbrains.dokka.model.doc.TagWrapper import org.jetbrains.dokka.model.properties.WithExtraProperties import org.jetbrains.dokka.pages.* import org.jetbrains.dokka.utilities.DokkaLogger @@ -78,9 +75,8 @@ open class DefaultPageCreator( protected open fun contentForPackage(p: DPackage) = contentBuilder.contentFor(p) { group(p.dri, p.platformData.toSet(), ContentKind.Packages) { header(1) { text("Package ${p.name}") } - +contentForComments(p) } - header(1) { text("Package ${p.name}") } + +contentForComments(p) +contentForScope(p, p.dri, p.platformData) block("Type aliases", 2, ContentKind.TypeAliases, p.typealiases, p.platformData.toSet()) { link(it.name, it.dri) diff --git a/plugins/base/src/test/kotlin/renderers/RenderingOnlyTestBase.kt b/plugins/base/src/test/kotlin/renderers/RenderingOnlyTestBase.kt index 852ac735..5f8d1dc4 100644 --- a/plugins/base/src/test/kotlin/renderers/RenderingOnlyTestBase.kt +++ b/plugins/base/src/test/kotlin/renderers/RenderingOnlyTestBase.kt @@ -1,5 +1,6 @@ package renderers +import org.jetbrains.dokka.DokkaConfigurationImpl import org.jetbrains.dokka.base.DokkaBase import org.jetbrains.dokka.base.renderers.html.RootCreator import org.jetbrains.dokka.base.resolvers.external.DokkaExternalLocationProviderFactory @@ -9,6 +10,7 @@ import org.jetbrains.dokka.base.resolvers.local.LocationProvider import org.jetbrains.dokka.base.resolvers.local.LocationProviderFactory import org.jetbrains.dokka.base.signatures.KotlinSignatureProvider import org.jetbrains.dokka.base.transformers.pages.comments.CommentsToContentConverter +import org.jetbrains.dokka.base.transformers.pages.samples.DefaultSamplesTransformer import org.jetbrains.dokka.base.translators.documentables.PageContentBuilder import org.jetbrains.dokka.links.DRI import org.jetbrains.dokka.model.Documentable @@ -28,9 +30,11 @@ abstract class RenderingOnlyTestBase { val context = MockContext( DokkaBase().outputWriter to { _ -> files }, DokkaBase().locationProviderFactory to ::DefaultLocationProviderFactory, + DokkaBase().samplesTransformer to ::DefaultSamplesTransformer, DokkaBase().htmlPreprocessors to { _ -> RootCreator }, DokkaBase().externalLocationProviderFactory to { _ -> ::JavadocExternalLocationProviderFactory }, - DokkaBase().externalLocationProviderFactory to { _ -> ::DokkaExternalLocationProviderFactory } + DokkaBase().externalLocationProviderFactory to { _ -> ::DokkaExternalLocationProviderFactory }, + testConfiguration = DokkaConfigurationImpl("", "", false, null, emptyList(), emptyList(), emptyList()) ) protected val renderedContent: Element by lazy { |