aboutsummaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorAndrzej Ratajczak <andrzej.ratajczak98@gmail.com>2020-06-01 13:49:32 +0200
committerPaweł Marks <Kordyjan@users.noreply.github.com>2020-06-02 16:05:48 +0200
commit02ddcd61dea19efd60c0da972ac0b5bd1d6ebf89 (patch)
tree6bd4bd274c458689667754f0c7354c0d9e582847 /plugins
parent5696054ce504a46ccc4a31141301c6755f998710 (diff)
downloaddokka-02ddcd61dea19efd60c0da972ac0b5bd1d6ebf89.tar.gz
dokka-02ddcd61dea19efd60c0da972ac0b5bd1d6ebf89.tar.bz2
dokka-02ddcd61dea19efd60c0da972ac0b5bd1d6ebf89.zip
Divergent samples fix
Diffstat (limited to 'plugins')
-rw-r--r--plugins/base/src/main/kotlin/DokkaBase.kt8
-rw-r--r--plugins/base/src/main/kotlin/renderers/html/HtmlRenderer.kt3
-rw-r--r--plugins/base/src/test/kotlin/renderers/RenderingOnlyTestBase.kt1
3 files changed, 4 insertions, 8 deletions
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<PageMergerStrategy>()
@@ -40,7 +37,6 @@ class DokkaBase : DokkaPlugin() {
val externalLocationProviderFactory by extensionPoint<ExternalLocationProviderFactory>()
val outputWriter by extensionPoint<OutputWriter>()
val htmlPreprocessors by extensionPoint<PageTransformer>()
- val samplesTransformer by extensionPoint<SamplesTransformer>()
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<String>()
- override val preprocessors = context.plugin<DokkaBase>().query { htmlPreprocessors } +
- context.plugin<DokkaBase>().querySingle { samplesTransformer }
+ override val preprocessors = context.plugin<DokkaBase>().query { htmlPreprocessors }
override fun FlowContent.wrapGroup(
node: ContentGroup,
diff --git a/plugins/base/src/test/kotlin/renderers/RenderingOnlyTestBase.kt b/plugins/base/src/test/kotlin/renderers/RenderingOnlyTestBase.kt
index 08d4a7b6..9a3e8015 100644
--- a/plugins/base/src/test/kotlin/renderers/RenderingOnlyTestBase.kt
+++ b/plugins/base/src/test/kotlin/renderers/RenderingOnlyTestBase.kt
@@ -32,7 +32,6 @@ 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 },