From 02ddcd61dea19efd60c0da972ac0b5bd1d6ebf89 Mon Sep 17 00:00:00 2001 From: Andrzej Ratajczak Date: Mon, 1 Jun 2020 13:49:32 +0200 Subject: Divergent samples fix --- plugins/base/src/main/kotlin/DokkaBase.kt | 8 +++----- plugins/base/src/main/kotlin/renderers/html/HtmlRenderer.kt | 3 +-- 2 files changed, 4 insertions(+), 7 deletions(-) (limited to 'plugins/base/src/main/kotlin') diff --git a/plugins/base/src/main/kotlin/DokkaBase.kt b/plugins/base/src/main/kotlin/DokkaBase.kt index 382b8f86..f217bbf1 100644 --- a/plugins/base/src/main/kotlin/DokkaBase.kt +++ b/plugins/base/src/main/kotlin/DokkaBase.kt @@ -21,16 +21,13 @@ import org.jetbrains.dokka.base.transformers.pages.merger.PageMerger import org.jetbrains.dokka.base.transformers.pages.merger.PageMergerStrategy import org.jetbrains.dokka.base.transformers.pages.merger.SameMethodNamePageMergerStrategy import org.jetbrains.dokka.base.transformers.pages.samples.DefaultSamplesTransformer -import org.jetbrains.dokka.base.transformers.pages.samples.SamplesTransformer import org.jetbrains.dokka.base.transformers.pages.sourcelinks.SourceLinksTransformer import org.jetbrains.dokka.base.translators.descriptors.DefaultDescriptorToDocumentableTranslator import org.jetbrains.dokka.base.translators.documentables.DefaultDocumentableToPageTranslator import org.jetbrains.dokka.base.translators.documentables.PageContentBuilder import org.jetbrains.dokka.base.translators.psi.DefaultPsiToDocumentableTranslator -import org.jetbrains.dokka.pages.ContentDivergentGroup import org.jetbrains.dokka.plugability.DokkaPlugin import org.jetbrains.dokka.transformers.pages.PageTransformer -import org.jetbrains.kotlin.descriptors.PackageFragmentDescriptor class DokkaBase : DokkaPlugin() { val pageMergerStrategy by extensionPoint() @@ -40,7 +37,6 @@ class DokkaBase : DokkaPlugin() { val externalLocationProviderFactory by extensionPoint() val outputWriter by extensionPoint() val htmlPreprocessors by extensionPoint() - val samplesTransformer by extensionPoint() val descriptorToDocumentableTranslator by extending { CoreExtensions.sourceToDocumentableTranslator with DefaultDescriptorToDocumentableTranslator @@ -133,7 +129,9 @@ class DokkaBase : DokkaPlugin() { } val defaultSamplesTransformer by extending { - samplesTransformer providing ::DefaultSamplesTransformer + CoreExtensions.pageTransformer providing ::DefaultSamplesTransformer order { + before(pageMerger) + } } val sourceLinksTransformer by extending { diff --git a/plugins/base/src/main/kotlin/renderers/html/HtmlRenderer.kt b/plugins/base/src/main/kotlin/renderers/html/HtmlRenderer.kt index b089c71a..79e49d53 100644 --- a/plugins/base/src/main/kotlin/renderers/html/HtmlRenderer.kt +++ b/plugins/base/src/main/kotlin/renderers/html/HtmlRenderer.kt @@ -27,8 +27,7 @@ open class HtmlRenderer( private val pageList = mutableListOf() - override val preprocessors = context.plugin().query { htmlPreprocessors } + - context.plugin().querySingle { samplesTransformer } + override val preprocessors = context.plugin().query { htmlPreprocessors } override fun FlowContent.wrapGroup( node: ContentGroup, -- cgit