diff options
Diffstat (limited to 'core/src/main/kotlin/CoreExtensions.kt')
-rw-r--r-- | core/src/main/kotlin/CoreExtensions.kt | 35 |
1 files changed, 29 insertions, 6 deletions
diff --git a/core/src/main/kotlin/CoreExtensions.kt b/core/src/main/kotlin/CoreExtensions.kt index 6579cab2..f56cd854 100644 --- a/core/src/main/kotlin/CoreExtensions.kt +++ b/core/src/main/kotlin/CoreExtensions.kt @@ -1,14 +1,37 @@ package org.jetbrains.dokka -import org.jetbrains.dokka.Model.transformers.DocumentationNodeTransformer +import org.jetbrains.dokka.pages.MarkdownToContentConverter +import org.jetbrains.dokka.pages.PageNode +import org.jetbrains.dokka.plugability.DokkaContext import org.jetbrains.dokka.plugability.ExtensionPoint +import org.jetbrains.dokka.renderers.FileWriter import org.jetbrains.dokka.renderers.Renderer import org.jetbrains.dokka.resolvers.LocationProvider -import org.jetbrains.dokka.transformers.PageNodeTransformer +import org.jetbrains.dokka.transformers.descriptors.DescriptorToDocumentationTranslator +import org.jetbrains.dokka.transformers.documentation.DocumentationNodeMerger +import org.jetbrains.dokka.transformers.documentation.DocumentationNodeTransformer +import org.jetbrains.dokka.transformers.documentation.DocumentationToPageTranslator +import org.jetbrains.dokka.transformers.pages.PageNodeTransformer +import kotlin.reflect.KProperty + +/** + * Extension points declared by dokka core. + * Default values are stored in [org.jetbrains.dokka.plugability.DefaultExtensions] + */ object CoreExtensions { - val nodeTransformer = ExtensionPoint<DocumentationNodeTransformer>(this::class.qualifiedName!!, "nodeTransformer") - val pageTransformer = ExtensionPoint<PageNodeTransformer>(this::class.qualifiedName!!, "pageTransformer") - val renderer = ExtensionPoint<Renderer>(this::class.qualifiedName!!, "renderer") - val locationProvider = ExtensionPoint<LocationProvider>(this::class.qualifiedName!!, "locationProvider") + val descriptorToDocumentationTranslator by coreExtension<DescriptorToDocumentationTranslator>() + val documentationMerger by coreExtension<DocumentationNodeMerger>() + val documentationTransformer by coreExtension<DocumentationNodeTransformer>() + 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 fileExtension by coreExtension<String>() + + private fun <T: Any> coreExtension() = object { + operator fun provideDelegate(thisRef: CoreExtensions, property: KProperty<*>): Lazy<ExtensionPoint<T>> = + lazy { ExtensionPoint<T>(thisRef::class.qualifiedName!!, property.name) } + } }
\ No newline at end of file |