diff options
author | Kamil Doległo <kamilok1965@interia.pl> | 2020-02-18 17:47:14 +0100 |
---|---|---|
committer | Paweł Marks <Kordyjan@users.noreply.github.com> | 2020-02-19 12:56:26 +0100 |
commit | bee52be815bebd7012193728521636b5fbed2829 (patch) | |
tree | 5195190ed7944ee602ce177b04f7184d913c3bf6 /plugins/base/src/main | |
parent | 16c84aff273a4bcef88f7e808e8b8eba2e7fd313 (diff) | |
download | dokka-bee52be815bebd7012193728521636b5fbed2829.tar.gz dokka-bee52be815bebd7012193728521636b5fbed2829.tar.bz2 dokka-bee52be815bebd7012193728521636b5fbed2829.zip |
Rename extensions to make them more uniform
Diffstat (limited to 'plugins/base/src/main')
7 files changed, 30 insertions, 30 deletions
diff --git a/plugins/base/src/main/kotlin/DokkaBase.kt b/plugins/base/src/main/kotlin/DokkaBase.kt index e7cd61a8..489da3ef 100644 --- a/plugins/base/src/main/kotlin/DokkaBase.kt +++ b/plugins/base/src/main/kotlin/DokkaBase.kt @@ -7,15 +7,15 @@ import org.jetbrains.dokka.base.renderers.html.HtmlRenderer import org.jetbrains.dokka.base.resolvers.DefaultLocationProviderFactory import org.jetbrains.dokka.base.resolvers.LocationProviderFactory import org.jetbrains.dokka.base.transformers.documentables.DefaultDocumentableMerger -import org.jetbrains.dokka.base.translators.documentables.DefaultDocumentablesToPageTranslator import org.jetbrains.dokka.base.transformers.pages.comments.CommentsToContentConverter import org.jetbrains.dokka.base.transformers.pages.comments.DocTagToContentConverter import org.jetbrains.dokka.base.transformers.pages.merger.FallbackPageMergerStrategy +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.PageNodeMerger import org.jetbrains.dokka.base.transformers.pages.merger.SameMethodNamePageMergerStrategy -import org.jetbrains.dokka.base.transformers.psi.DefaultPsiToDocumentationTranslator -import org.jetbrains.dokka.base.translators.descriptors.DefaultDescriptorToDocumentationTranslator +import org.jetbrains.dokka.base.transformers.psi.DefaultPsiToDocumentableTranslator +import org.jetbrains.dokka.base.translators.descriptors.DefaultDescriptorToDocumentableTranslator +import org.jetbrains.dokka.base.translators.documentables.DefaultDocumentableToPageTranslator import org.jetbrains.dokka.plugability.DokkaPlugin class DokkaBase : DokkaPlugin() { @@ -24,21 +24,21 @@ class DokkaBase : DokkaPlugin() { val locationProviderFactory by extensionPoint<LocationProviderFactory>() val outputWriter by extensionPoint<OutputWriter>() - val descriptorToDocumentationTranslator by extending(isFallback = true) { - CoreExtensions.descriptorToDocumentationTranslator providing ::DefaultDescriptorToDocumentationTranslator + val descriptorToDocumentableTranslator by extending(isFallback = true) { + CoreExtensions.descriptorToDocumentableTranslator providing ::DefaultDescriptorToDocumentableTranslator } - val psiToDocumentationTranslator by extending(isFallback = true) { - CoreExtensions.psiToDocumentationTranslator with DefaultPsiToDocumentationTranslator + val psiToDocumentableTranslator by extending(isFallback = true) { + CoreExtensions.psiToDocumentableTranslator with DefaultPsiToDocumentableTranslator } val documentableMerger by extending(isFallback = true) { CoreExtensions.documentableMerger with DefaultDocumentableMerger } - val documentablesToPageTranslator by extending(isFallback = true) { - CoreExtensions.documentablesToPageTranslator providing { ctx -> - DefaultDocumentablesToPageTranslator(ctx.single(commentsToContentConverter), ctx.logger) + val documentableToPageTranslator by extending(isFallback = true) { + CoreExtensions.documentableToPageTranslator providing { ctx -> + DefaultDocumentableToPageTranslator(ctx.single(commentsToContentConverter), ctx.logger) } } @@ -47,7 +47,7 @@ class DokkaBase : DokkaPlugin() { } val pageMerger by extending { - CoreExtensions.pageTransformer providing { ctx -> PageNodeMerger(ctx[pageMergerStrategy]) } + CoreExtensions.pageTransformer providing { ctx -> PageMerger(ctx[pageMergerStrategy]) } } val fallbackMerger by extending { diff --git a/plugins/base/src/main/kotlin/renderers/DefaultRenderer.kt b/plugins/base/src/main/kotlin/renderers/DefaultRenderer.kt index 75034bda..9c22c879 100644 --- a/plugins/base/src/main/kotlin/renderers/DefaultRenderer.kt +++ b/plugins/base/src/main/kotlin/renderers/DefaultRenderer.kt @@ -7,7 +7,7 @@ import org.jetbrains.dokka.plugability.DokkaContext import org.jetbrains.dokka.plugability.plugin import org.jetbrains.dokka.plugability.querySingle import org.jetbrains.dokka.renderers.Renderer -import org.jetbrains.dokka.transformers.pages.PageNodeTransformer +import org.jetbrains.dokka.transformers.pages.PageTransformer abstract class DefaultRenderer<T>( protected val context: DokkaContext @@ -18,7 +18,7 @@ abstract class DefaultRenderer<T>( protected lateinit var locationProvider: LocationProvider private set - protected open val preprocessors: Iterable<PageNodeTransformer> = emptyList() + protected open val preprocessors: Iterable<PageTransformer> = emptyList() abstract fun T.buildHeader(level: Int, content: T.() -> Unit) abstract fun T.buildLink(address: String, content: T.() -> Unit) diff --git a/plugins/base/src/main/kotlin/renderers/html/htmlPreprocessors.kt b/plugins/base/src/main/kotlin/renderers/html/htmlPreprocessors.kt index ecd2e89a..9db0f2a8 100644 --- a/plugins/base/src/main/kotlin/renderers/html/htmlPreprocessors.kt +++ b/plugins/base/src/main/kotlin/renderers/html/htmlPreprocessors.kt @@ -6,14 +6,14 @@ import kotlinx.html.table import kotlinx.html.tbody import org.jetbrains.dokka.base.renderers.platforms import org.jetbrains.dokka.pages.* -import org.jetbrains.dokka.transformers.pages.PageNodeTransformer +import org.jetbrains.dokka.transformers.pages.PageTransformer -object RootCreator : PageNodeTransformer { +object RootCreator : PageTransformer { override fun invoke(input: RootPageNode) = RendererSpecificRootPage("", listOf(input), RenderingStrategy.DoNothing) } -object SearchPageInstaller : PageNodeTransformer { +object SearchPageInstaller : PageTransformer { override fun invoke(input: RootPageNode) = input.modified(children = input.children + searchPage) private val searchPage = RendererSpecificResourcePage( @@ -34,7 +34,7 @@ object SearchPageInstaller : PageNodeTransformer { }) } -object NavigationPageInstaller : PageNodeTransformer { +object NavigationPageInstaller : PageTransformer { override fun invoke(input: RootPageNode) = input.modified( children = input.children + NavigationPage( input.children.filterIsInstance<ContentPage>().single().let(::visit) @@ -48,7 +48,7 @@ object NavigationPageInstaller : PageNodeTransformer { page.children.filterIsInstance<ContentPage>().map { visit(it) }) } -object ResourceInstaller : PageNodeTransformer { +object ResourceInstaller : PageTransformer { override fun invoke(input: RootPageNode) = input.modified(children = input.children + resourcePages) private val resourcePages = listOf("styles", "scripts", "images").map { @@ -56,7 +56,7 @@ object ResourceInstaller : PageNodeTransformer { } } -object StyleAndScriptsAppender : PageNodeTransformer { +object StyleAndScriptsAppender : PageTransformer { override fun invoke(input: RootPageNode) = input.transformContentPagesTree { it.modified( embeddedResources = it.embeddedResources + listOf( diff --git a/plugins/base/src/main/kotlin/transformers/pages/merger/PageNodeMerger.kt b/plugins/base/src/main/kotlin/transformers/pages/merger/PageMerger.kt index 96cd126c..93d42e7e 100644 --- a/plugins/base/src/main/kotlin/transformers/pages/merger/PageNodeMerger.kt +++ b/plugins/base/src/main/kotlin/transformers/pages/merger/PageMerger.kt @@ -2,9 +2,9 @@ package org.jetbrains.dokka.base.transformers.pages.merger import org.jetbrains.dokka.pages.PageNode import org.jetbrains.dokka.pages.RootPageNode -import org.jetbrains.dokka.transformers.pages.PageNodeTransformer +import org.jetbrains.dokka.transformers.pages.PageTransformer -class PageNodeMerger(private val strategies: Iterable<PageMergerStrategy>) : PageNodeTransformer { +class PageMerger(private val strategies: Iterable<PageMergerStrategy>) : PageTransformer { override fun invoke(input: RootPageNode): RootPageNode = input.modified(children = input.children.map { it.mergeChildren(emptyList()) }) diff --git a/plugins/base/src/main/kotlin/transformers/psi/DefaultPsiToDocumentationTranslator.kt b/plugins/base/src/main/kotlin/transformers/psi/DefaultPsiToDocumentableTranslator.kt index b913ae88..364cb34b 100644 --- a/plugins/base/src/main/kotlin/transformers/psi/DefaultPsiToDocumentationTranslator.kt +++ b/plugins/base/src/main/kotlin/transformers/psi/DefaultPsiToDocumentableTranslator.kt @@ -10,11 +10,11 @@ import org.jetbrains.dokka.model.* import org.jetbrains.dokka.model.Function import org.jetbrains.dokka.pages.PlatformData import org.jetbrains.dokka.plugability.DokkaContext -import org.jetbrains.dokka.transformers.psi.PsiToDocumentationTranslator +import org.jetbrains.dokka.transformers.psi.PsiToDocumentableTranslator import org.jetbrains.dokka.utilities.DokkaLogger import org.jetbrains.kotlin.descriptors.Visibilities -object DefaultPsiToDocumentationTranslator : PsiToDocumentationTranslator { +object DefaultPsiToDocumentableTranslator : PsiToDocumentableTranslator { override fun invoke( moduleName: String, diff --git a/plugins/base/src/main/kotlin/translators/descriptors/DefaultDescriptorToDocumentationTranslator.kt b/plugins/base/src/main/kotlin/translators/descriptors/DefaultDescriptorToDocumentableTranslator.kt index bb572034..95795ece 100644 --- a/plugins/base/src/main/kotlin/translators/descriptors/DefaultDescriptorToDocumentationTranslator.kt +++ b/plugins/base/src/main/kotlin/translators/descriptors/DefaultDescriptorToDocumentableTranslator.kt @@ -12,7 +12,7 @@ import org.jetbrains.dokka.model.doc.* import org.jetbrains.dokka.pages.PlatformData import org.jetbrains.dokka.parsers.MarkdownParser import org.jetbrains.dokka.plugability.DokkaContext -import org.jetbrains.dokka.transformers.descriptors.DescriptorToDocumentationTranslator +import org.jetbrains.dokka.transformers.descriptors.DescriptorToDocumentableTranslator import org.jetbrains.kotlin.descriptors.* import org.jetbrains.kotlin.descriptors.impl.DeclarationDescriptorVisitorEmptyBodies import org.jetbrains.kotlin.idea.kdoc.findKDoc @@ -22,9 +22,9 @@ import org.jetbrains.kotlin.resolve.scopes.DescriptorKindFilter import org.jetbrains.kotlin.resolve.scopes.MemberScope import kotlin.reflect.KClass -class DefaultDescriptorToDocumentationTranslator( +class DefaultDescriptorToDocumentableTranslator( private val context: DokkaContext -) : DescriptorToDocumentationTranslator { +) : DescriptorToDocumentableTranslator { override fun invoke( moduleName: String, packageFragments: Iterable<PackageFragmentDescriptor>, diff --git a/plugins/base/src/main/kotlin/translators/documentables/DefaultDocumentablesToPageTranslator.kt b/plugins/base/src/main/kotlin/translators/documentables/DefaultDocumentableToPageTranslator.kt index ee3ae995..f577c8f4 100644 --- a/plugins/base/src/main/kotlin/translators/documentables/DefaultDocumentablesToPageTranslator.kt +++ b/plugins/base/src/main/kotlin/translators/documentables/DefaultDocumentableToPageTranslator.kt @@ -3,14 +3,14 @@ package org.jetbrains.dokka.base.translators.documentables import org.jetbrains.dokka.base.transformers.pages.comments.CommentsToContentConverter import org.jetbrains.dokka.model.Module import org.jetbrains.dokka.pages.ModulePageNode -import org.jetbrains.dokka.transformers.documentation.DocumentablesToPageTranslator +import org.jetbrains.dokka.transformers.documentation.DocumentableToPageTranslator import org.jetbrains.dokka.utilities.DokkaLogger -class DefaultDocumentablesToPageTranslator( +class DefaultDocumentableToPageTranslator( private val commentsToContentConverter: CommentsToContentConverter, private val logger: DokkaLogger -) : DocumentablesToPageTranslator { +) : DocumentableToPageTranslator { override fun invoke(module: Module): ModulePageNode = DefaultPageBuilder { node, kind, operation -> DefaultPageContentBuilder.group( |