From 5a432c9c62ff95779a495fb354c83f5f7c481a1d Mon Sep 17 00:00:00 2001 From: Andrzej Ratajczak Date: Tue, 11 Feb 2020 15:33:37 +0100 Subject: Removed default file extension extension point --- core/src/main/kotlin/renderers/DefaultRenderer.kt | 4 ++-- core/src/main/kotlin/renderers/FileWriter.kt | 2 +- core/src/main/kotlin/renderers/OutputWriter.kt | 6 +----- 3 files changed, 4 insertions(+), 8 deletions(-) (limited to 'core/src/main/kotlin/renderers') diff --git a/core/src/main/kotlin/renderers/DefaultRenderer.kt b/core/src/main/kotlin/renderers/DefaultRenderer.kt index 4b4d6fd3..16cdb4c1 100644 --- a/core/src/main/kotlin/renderers/DefaultRenderer.kt +++ b/core/src/main/kotlin/renderers/DefaultRenderer.kt @@ -75,11 +75,11 @@ abstract class DefaultRenderer( open fun renderPage(page: PageNode) { val path by lazy { locationProvider.resolve(page, skipExtension = true) } when (page) { - is ContentPage -> outputWriter.write(path, buildPage(page) { c, p -> buildPageContent(c, p) }) + is ContentPage -> outputWriter.write(path, buildPage(page) { c, p -> buildPageContent(c, p) }, ".html") is RendererSpecificPage -> when (val strategy = page.strategy) { is RenderingStrategy.Copy -> outputWriter.writeResources(strategy.from, path) is RenderingStrategy.Write -> outputWriter.write(path, strategy.text, "") - is RenderingStrategy.Callback -> outputWriter.write(path, strategy.instructions(this, page)) + is RenderingStrategy.Callback -> outputWriter.write(path, strategy.instructions(this, page), ".html") RenderingStrategy.DoNothing -> Unit } else -> throw AssertionError( diff --git a/core/src/main/kotlin/renderers/FileWriter.kt b/core/src/main/kotlin/renderers/FileWriter.kt index 83bb9ce3..727a8d21 100644 --- a/core/src/main/kotlin/renderers/FileWriter.kt +++ b/core/src/main/kotlin/renderers/FileWriter.kt @@ -6,7 +6,7 @@ import java.io.IOException import java.net.URI import java.nio.file.* -class FileWriter(override val context: DokkaContext): OutputWriter { +class FileWriter(val context: DokkaContext): OutputWriter { private val createdFiles: MutableSet = mutableSetOf() private val jarUriPrefix = "jar:file:" private val root = context.configuration.outputDir diff --git a/core/src/main/kotlin/renderers/OutputWriter.kt b/core/src/main/kotlin/renderers/OutputWriter.kt index b2059aa3..30b2b0b6 100644 --- a/core/src/main/kotlin/renderers/OutputWriter.kt +++ b/core/src/main/kotlin/renderers/OutputWriter.kt @@ -6,10 +6,6 @@ import org.jetbrains.dokka.plugability.single interface OutputWriter { - val context: DokkaContext - val extension: String - get() = context.single(CoreExtensions.fileExtension) - - fun write(path: String, text: String, ext: String = extension) + fun write(path: String, text: String, ext: String) fun writeResources(pathFrom: String, pathTo: String) } \ No newline at end of file -- cgit