diff options
author | Paweł Marks <pmarks@virtuslab.com> | 2019-11-26 20:57:47 +0100 |
---|---|---|
committer | Paweł Marks <pmarks@virtuslab.com> | 2019-11-26 21:02:32 +0100 |
commit | 970bb62105af3828234eb871230ee9c1cd216af7 (patch) | |
tree | 382ec69635875fc52f417ffc9c1b9ee455d802b7 | |
parent | 49439594f86217d8a25e8df2580b8ef29d836230 (diff) | |
download | dokka-970bb62105af3828234eb871230ee9c1cd216af7.tar.gz dokka-970bb62105af3828234eb871230ee9c1cd216af7.tar.bz2 dokka-970bb62105af3828234eb871230ee9c1cd216af7.zip |
Making names of extension points more consistent
-rw-r--r-- | core/src/main/kotlin/CoreExtensions.kt | 4 | ||||
-rw-r--r-- | core/src/main/kotlin/DokkaGenerator.kt | 13 | ||||
-rw-r--r-- | core/src/main/kotlin/plugability/DefaultExtensions.kt | 5 |
3 files changed, 6 insertions, 16 deletions
diff --git a/core/src/main/kotlin/CoreExtensions.kt b/core/src/main/kotlin/CoreExtensions.kt index f56cd854..87509dc4 100644 --- a/core/src/main/kotlin/CoreExtensions.kt +++ b/core/src/main/kotlin/CoreExtensions.kt @@ -26,8 +26,8 @@ object CoreExtensions { val markdownToContentConverterFactory by coreExtension<(DokkaContext) -> MarkdownToContentConverter>() val documentationToPageTranslator by coreExtension<DocumentationToPageTranslator>() val pageTransformer by coreExtension<PageNodeTransformer>() - val renderer by coreExtension<(FileWriter, LocationProvider, DokkaContext) -> Renderer>() - val locationProvider by coreExtension<(root: PageNode, DokkaConfiguration, DokkaContext) -> LocationProvider>() + val rendererFactory by coreExtension<(FileWriter, LocationProvider, DokkaContext) -> Renderer>() + val locationProviderFactory by coreExtension<(root: PageNode, DokkaConfiguration, DokkaContext) -> LocationProvider>() val fileExtension by coreExtension<String>() private fun <T: Any> coreExtension() = object { diff --git a/core/src/main/kotlin/DokkaGenerator.kt b/core/src/main/kotlin/DokkaGenerator.kt index b6bf7a73..2efcca5a 100644 --- a/core/src/main/kotlin/DokkaGenerator.kt +++ b/core/src/main/kotlin/DokkaGenerator.kt @@ -1,19 +1,10 @@ package org.jetbrains.dokka import org.jetbrains.dokka.Model.Module -import org.jetbrains.dokka.Utilities.pretty -import org.jetbrains.dokka.links.DRI -import org.jetbrains.dokka.pages.DefaultMarkdownToContentConverter import org.jetbrains.dokka.pages.PlatformData import org.jetbrains.dokka.plugability.DokkaContext import org.jetbrains.dokka.plugability.single import org.jetbrains.dokka.renderers.FileWriter -import org.jetbrains.dokka.renderers.HtmlRenderer -import org.jetbrains.dokka.resolvers.DefaultLocationProvider -import org.jetbrains.dokka.resolvers.LocationProvider -import org.jetbrains.dokka.transformers.documentation.DefaultDocumentationToPageTranslator -import org.jetbrains.dokka.transformers.descriptors.DokkaDescriptorVisitor -import org.jetbrains.dokka.transformers.documentation.DefaultDocumentationNodeMerger import org.jetbrains.kotlin.cli.common.messages.CompilerMessageLocation import org.jetbrains.kotlin.cli.common.messages.CompilerMessageSeverity import org.jetbrains.kotlin.cli.common.messages.MessageCollector @@ -57,9 +48,9 @@ class DokkaGenerator( logger.debug("Rendering") val fileWriter = FileWriter(configuration.outputDir, "") - val locationProvider = context.single(CoreExtensions.locationProvider) + val locationProvider = context.single(CoreExtensions.locationProviderFactory) .invoke(transformedPages, configuration, context) - val renderer = context.single(CoreExtensions.renderer) + val renderer = context.single(CoreExtensions.rendererFactory) .invoke(fileWriter, locationProvider, context) renderer.render(transformedPages) diff --git a/core/src/main/kotlin/plugability/DefaultExtensions.kt b/core/src/main/kotlin/plugability/DefaultExtensions.kt index dd656386..d89fc031 100644 --- a/core/src/main/kotlin/plugability/DefaultExtensions.kt +++ b/core/src/main/kotlin/plugability/DefaultExtensions.kt @@ -2,7 +2,6 @@ package org.jetbrains.dokka.plugability import org.jetbrains.dokka.CoreExtensions import org.jetbrains.dokka.pages.DefaultMarkdownToContentConverter -import org.jetbrains.dokka.renderers.DefaultRenderer import org.jetbrains.dokka.renderers.HtmlRenderer import org.jetbrains.dokka.resolvers.DefaultLocationProvider import org.jetbrains.dokka.transformers.descriptors.DefaultDescriptorToDocumentationTranslator @@ -17,8 +16,8 @@ object DefaultExtensions : DokkaExtensionHandler { CoreExtensions.documentationMerger -> DefaultDocumentationNodeMerger CoreExtensions.markdownToContentConverterFactory -> ::DefaultMarkdownToContentConverter CoreExtensions.documentationToPageTranslator -> DefaultDocumentationToPageTranslator - CoreExtensions.renderer -> ::HtmlRenderer - CoreExtensions.locationProvider -> ::DefaultLocationProvider + CoreExtensions.rendererFactory -> ::HtmlRenderer + CoreExtensions.locationProviderFactory -> ::DefaultLocationProvider CoreExtensions.fileExtension -> ".html" else -> null }.let { listOfNotNull(it) as List<T> } |