aboutsummaryrefslogtreecommitdiff
path: root/core/src/main/kotlin/plugability/DefaultExtensions.kt
diff options
context:
space:
mode:
authorAndrzej Ratajczak <andrzej.ratajczak98@gmail.com>2020-01-16 10:51:55 +0100
committerPaweł Marks <Kordyjan@users.noreply.github.com>2020-01-16 11:55:53 +0100
commit69d2663ff7de9fb4e4b1d0bc0b82f7653f70dad1 (patch)
tree304f1fd2fc3a93a13df3f2fc7b49347568138216 /core/src/main/kotlin/plugability/DefaultExtensions.kt
parent0917459a2eafabc563e79579a0322bb7832cae1f (diff)
downloaddokka-69d2663ff7de9fb4e4b1d0bc0b82f7653f70dad1.tar.gz
dokka-69d2663ff7de9fb4e4b1d0bc0b82f7653f70dad1.tar.bz2
dokka-69d2663ff7de9fb4e4b1d0bc0b82f7653f70dad1.zip
Applies requested changes
Diffstat (limited to 'core/src/main/kotlin/plugability/DefaultExtensions.kt')
-rw-r--r--core/src/main/kotlin/plugability/DefaultExtensions.kt12
1 files changed, 9 insertions, 3 deletions
diff --git a/core/src/main/kotlin/plugability/DefaultExtensions.kt b/core/src/main/kotlin/plugability/DefaultExtensions.kt
index 58b686f3..b3ff4248 100644
--- a/core/src/main/kotlin/plugability/DefaultExtensions.kt
+++ b/core/src/main/kotlin/plugability/DefaultExtensions.kt
@@ -10,15 +10,21 @@ import org.jetbrains.dokka.transformers.documentation.DefaultDocumentationNodeMe
import org.jetbrains.dokka.transformers.documentation.DefaultDocumentationToPageTranslator
internal object DefaultExtensions {
+
+ private val renderer: LazyEvaluated<HtmlRenderer> = LazyEvaluated.fromRecipe { HtmlRenderer(it.single(CoreExtensions.outputWriter), it) }
+ private val converter: LazyEvaluated<DocTagToContentConverter> = LazyEvaluated.fromRecipe {DocTagToContentConverter(it) }
+ private val providerFactory: LazyEvaluated<DefaultLocationProviderFactory> = LazyEvaluated.fromRecipe { DefaultLocationProviderFactory(it) }
+
+
@Suppress("IMPLICIT_CAST_TO_ANY", "UNCHECKED_CAST")
internal fun <T : Any, E : ExtensionPoint<T>> get(point: E, fullContext: DokkaContext): List<T> =
when (point) {
CoreExtensions.descriptorToDocumentationTranslator -> DefaultDescriptorToDocumentationTranslator
CoreExtensions.documentationMerger -> DefaultDocumentationNodeMerger
- CoreExtensions.commentsToContentConverter -> DocTagToContentConverter(fullContext)
+ CoreExtensions.commentsToContentConverter -> converter.get(fullContext)
CoreExtensions.documentationToPageTranslator -> DefaultDocumentationToPageTranslator
- CoreExtensions.renderer -> HtmlRenderer(fullContext.single(CoreExtensions.outputWriter), fullContext)
- CoreExtensions.locationProviderFactory -> DefaultLocationProviderFactory
+ CoreExtensions.renderer -> renderer.get(fullContext)
+ CoreExtensions.locationProviderFactory -> providerFactory.get(fullContext)
CoreExtensions.outputWriter -> FileWriter(fullContext.configuration.outputDir, "")
CoreExtensions.fileExtension -> ".html"
else -> null