aboutsummaryrefslogtreecommitdiff
path: root/core/src/main
diff options
context:
space:
mode:
authorKamil Doległo <kamilok1965@interia.pl>2020-02-18 17:47:14 +0100
committerPaweł Marks <Kordyjan@users.noreply.github.com>2020-02-19 12:56:26 +0100
commitbee52be815bebd7012193728521636b5fbed2829 (patch)
tree5195190ed7944ee602ce177b04f7184d913c3bf6 /core/src/main
parent16c84aff273a4bcef88f7e808e8b8eba2e7fd313 (diff)
downloaddokka-bee52be815bebd7012193728521636b5fbed2829.tar.gz
dokka-bee52be815bebd7012193728521636b5fbed2829.tar.bz2
dokka-bee52be815bebd7012193728521636b5fbed2829.zip
Rename extensions to make them more uniform
Diffstat (limited to 'core/src/main')
-rw-r--r--core/src/main/kotlin/CoreExtensions.kt20
-rw-r--r--core/src/main/kotlin/DokkaGenerator.kt8
-rw-r--r--core/src/main/kotlin/transformers/descriptors/DescriptorToDocumentableTranslator.kt (renamed from core/src/main/kotlin/transformers/descriptors/DescriptorToDocumentationTranslator.kt)3
-rw-r--r--core/src/main/kotlin/transformers/documentation/DocumentableToPageTranslator.kt (renamed from core/src/main/kotlin/transformers/documentation/DocumentablesToPageTranslator.kt)3
-rw-r--r--core/src/main/kotlin/transformers/documentation/DocumentableTransformer.kt (renamed from core/src/main/kotlin/transformers/documentation/DocumentationNodeTransformer.kt)2
-rw-r--r--core/src/main/kotlin/transformers/pages/PageTransformer.kt (renamed from core/src/main/kotlin/transformers/pages/PageNodeTransformer.kt)4
-rw-r--r--core/src/main/kotlin/transformers/psi/PsiToDocumentableTranslator.kt (renamed from core/src/main/kotlin/transformers/psi/PsiToDocumentationTranslator.kt)2
7 files changed, 19 insertions, 23 deletions
diff --git a/core/src/main/kotlin/CoreExtensions.kt b/core/src/main/kotlin/CoreExtensions.kt
index 82a1c367..dd6eab1b 100644
--- a/core/src/main/kotlin/CoreExtensions.kt
+++ b/core/src/main/kotlin/CoreExtensions.kt
@@ -2,21 +2,21 @@ package org.jetbrains.dokka
import org.jetbrains.dokka.plugability.ExtensionPoint
import org.jetbrains.dokka.renderers.Renderer
-import org.jetbrains.dokka.transformers.descriptors.DescriptorToDocumentationTranslator
+import org.jetbrains.dokka.transformers.descriptors.DescriptorToDocumentableTranslator
import org.jetbrains.dokka.transformers.documentation.DocumentableMerger
-import org.jetbrains.dokka.transformers.documentation.DocumentationNodeTransformer
-import org.jetbrains.dokka.transformers.documentation.DocumentablesToPageTranslator
-import org.jetbrains.dokka.transformers.pages.PageNodeTransformer
-import org.jetbrains.dokka.transformers.psi.PsiToDocumentationTranslator
+import org.jetbrains.dokka.transformers.documentation.DocumentableToPageTranslator
+import org.jetbrains.dokka.transformers.documentation.DocumentableTransformer
+import org.jetbrains.dokka.transformers.pages.PageTransformer
+import org.jetbrains.dokka.transformers.psi.PsiToDocumentableTranslator
import kotlin.reflect.KProperty
object CoreExtensions {
- val descriptorToDocumentationTranslator by coreExtension<DescriptorToDocumentationTranslator>()
- val psiToDocumentationTranslator by coreExtension<PsiToDocumentationTranslator>()
+ val descriptorToDocumentableTranslator by coreExtension<DescriptorToDocumentableTranslator>()
+ val psiToDocumentableTranslator by coreExtension<PsiToDocumentableTranslator>()
val documentableMerger by coreExtension<DocumentableMerger>()
- val documentationTransformer by coreExtension<DocumentationNodeTransformer>()
- val documentablesToPageTranslator by coreExtension<DocumentablesToPageTranslator>()
- val pageTransformer by coreExtension<PageNodeTransformer>()
+ val documentableTransformer by coreExtension<DocumentableTransformer>()
+ val documentableToPageTranslator by coreExtension<DocumentableToPageTranslator>()
+ val pageTransformer by coreExtension<PageTransformer>()
val renderer by coreExtension<Renderer>()
private fun <T: Any> coreExtension() = object {
diff --git a/core/src/main/kotlin/DokkaGenerator.kt b/core/src/main/kotlin/DokkaGenerator.kt
index 8897e68d..e318e969 100644
--- a/core/src/main/kotlin/DokkaGenerator.kt
+++ b/core/src/main/kotlin/DokkaGenerator.kt
@@ -83,12 +83,12 @@ class DokkaGenerator(
fun transformDocumentationModel(
documentationModel: Module,
context: DokkaContext
- ) = context[CoreExtensions.documentationTransformer].fold(documentationModel) { acc, t -> t(acc, context) }
+ ) = context[CoreExtensions.documentableTransformer].fold(documentationModel) { acc, t -> t(acc, context) }
fun createPages(
transformedDocumentation: Module,
context: DokkaContext
- ) = context.single(CoreExtensions.documentablesToPageTranslator).invoke(transformedDocumentation)
+ ) = context.single(CoreExtensions.documentableToPageTranslator).invoke(transformedDocumentation)
fun transformPages(
pages: RootPageNode,
@@ -128,7 +128,7 @@ class DokkaGenerator(
.mapNotNull { facade.resolveSession.getPackageFragment(it) }
.toList()
- return context.single(CoreExtensions.descriptorToDocumentationTranslator)
+ return context.single(CoreExtensions.descriptorToDocumentableTranslator)
.invoke(platformData.name, packageFragments, platformData)
}
@@ -149,7 +149,7 @@ class DokkaGenerator(
}.toList()
}.flatten()
- return context.single(CoreExtensions.psiToDocumentationTranslator)
+ return context.single(CoreExtensions.psiToDocumentableTranslator)
.invoke(platformData.name, psiFiles, platformData, context)
}
diff --git a/core/src/main/kotlin/transformers/descriptors/DescriptorToDocumentationTranslator.kt b/core/src/main/kotlin/transformers/descriptors/DescriptorToDocumentableTranslator.kt
index 5074833e..d72eeafd 100644
--- a/core/src/main/kotlin/transformers/descriptors/DescriptorToDocumentationTranslator.kt
+++ b/core/src/main/kotlin/transformers/descriptors/DescriptorToDocumentableTranslator.kt
@@ -2,10 +2,9 @@ package org.jetbrains.dokka.transformers.descriptors
import org.jetbrains.dokka.model.Module
import org.jetbrains.dokka.pages.PlatformData
-import org.jetbrains.dokka.plugability.DokkaContext
import org.jetbrains.kotlin.descriptors.PackageFragmentDescriptor
-interface DescriptorToDocumentationTranslator {
+interface DescriptorToDocumentableTranslator {
fun invoke(
moduleName: String,
packageFragments: Iterable<PackageFragmentDescriptor>,
diff --git a/core/src/main/kotlin/transformers/documentation/DocumentablesToPageTranslator.kt b/core/src/main/kotlin/transformers/documentation/DocumentableToPageTranslator.kt
index 19698fa0..e41e0c84 100644
--- a/core/src/main/kotlin/transformers/documentation/DocumentablesToPageTranslator.kt
+++ b/core/src/main/kotlin/transformers/documentation/DocumentableToPageTranslator.kt
@@ -2,8 +2,7 @@ package org.jetbrains.dokka.transformers.documentation
import org.jetbrains.dokka.model.Module
import org.jetbrains.dokka.pages.ModulePageNode
-import org.jetbrains.dokka.plugability.DokkaContext
-interface DocumentablesToPageTranslator {
+interface DocumentableToPageTranslator {
operator fun invoke(module: Module): ModulePageNode
} \ No newline at end of file
diff --git a/core/src/main/kotlin/transformers/documentation/DocumentationNodeTransformer.kt b/core/src/main/kotlin/transformers/documentation/DocumentableTransformer.kt
index d6358f07..88a1514d 100644
--- a/core/src/main/kotlin/transformers/documentation/DocumentationNodeTransformer.kt
+++ b/core/src/main/kotlin/transformers/documentation/DocumentableTransformer.kt
@@ -3,6 +3,6 @@ package org.jetbrains.dokka.transformers.documentation
import org.jetbrains.dokka.model.Module
import org.jetbrains.dokka.plugability.DokkaContext
-interface DocumentationNodeTransformer {
+interface DocumentableTransformer {
operator fun invoke(original: Module, context: DokkaContext): Module
} \ No newline at end of file
diff --git a/core/src/main/kotlin/transformers/pages/PageNodeTransformer.kt b/core/src/main/kotlin/transformers/pages/PageTransformer.kt
index 45357060..218d9821 100644
--- a/core/src/main/kotlin/transformers/pages/PageNodeTransformer.kt
+++ b/core/src/main/kotlin/transformers/pages/PageTransformer.kt
@@ -1,9 +1,7 @@
package org.jetbrains.dokka.transformers.pages
-import org.jetbrains.dokka.pages.ModulePageNode
import org.jetbrains.dokka.pages.RootPageNode
-import org.jetbrains.dokka.plugability.DokkaContext
-interface PageNodeTransformer {
+interface PageTransformer {
operator fun invoke(input: RootPageNode): RootPageNode
} \ No newline at end of file
diff --git a/core/src/main/kotlin/transformers/psi/PsiToDocumentationTranslator.kt b/core/src/main/kotlin/transformers/psi/PsiToDocumentableTranslator.kt
index 41290ef8..1ea07ff3 100644
--- a/core/src/main/kotlin/transformers/psi/PsiToDocumentationTranslator.kt
+++ b/core/src/main/kotlin/transformers/psi/PsiToDocumentableTranslator.kt
@@ -5,7 +5,7 @@ import org.jetbrains.dokka.model.Module
import org.jetbrains.dokka.pages.PlatformData
import org.jetbrains.dokka.plugability.DokkaContext
-interface PsiToDocumentationTranslator {
+interface PsiToDocumentableTranslator {
fun invoke(
moduleName: String,
psiFiles: List<PsiJavaFile>,