diff options
23 files changed, 167 insertions, 80 deletions
diff --git a/core/src/main/kotlin/plugability/DokkaContext.kt b/core/src/main/kotlin/plugability/DokkaContext.kt index 8703af4f..ee3215cc 100644 --- a/core/src/main/kotlin/plugability/DokkaContext.kt +++ b/core/src/main/kotlin/plugability/DokkaContext.kt @@ -128,7 +128,8 @@ private class DokkaContextConfigurationImpl( private fun findNotOverridden(bucket: Set<Extension<*, *, *>>): Extension<*, *, *> { val filtered = bucket.filter { it !in suppressedExtensions } - return filtered.singleOrNull() ?: throw IllegalStateException("Conflicting overrides: $filtered") + return filtered.singleOrNull() + ?: throw IllegalStateException("Conflicting overrides: $filtered") } private fun translateAdjacencyList( @@ -191,7 +192,9 @@ private class DokkaContextConfigurationImpl( } if (extension.override is OverrideKind.Present) { - suppressedExtensions.listFor(extension.override.overriden) += Suppression.ByExtension(extension) + extension.override.overriden.forEach { overriden -> + suppressedExtensions.listFor(overriden) += Suppression.ByExtension(extension) + } } } diff --git a/core/src/main/kotlin/plugability/DokkaJavaPlugin.kt b/core/src/main/kotlin/plugability/DokkaJavaPlugin.kt index 57ca520c..1d8ea8aa 100644 --- a/core/src/main/kotlin/plugability/DokkaJavaPlugin.kt +++ b/core/src/main/kotlin/plugability/DokkaJavaPlugin.kt @@ -46,7 +46,7 @@ data class ExtensionBuilder<T: Any> internal constructor( conditions ) - fun overrideExtension(extension: Extension<T, *, *>) = copy(override = OverrideKind.Present(extension)) + fun overrideExtension(extension: Extension<T, *, *>) = copy(override = OverrideKind.Present(listOf(extension))) fun newOrdering(before: Array<out Extension<*, *, *>>, after: Array<out Extension<*, *, *>>) = copy(before = this.before + before, after = this.after + after) diff --git a/core/src/main/kotlin/plugability/extensions.kt b/core/src/main/kotlin/plugability/extensions.kt index 46739951..8bac4c3e 100644 --- a/core/src/main/kotlin/plugability/extensions.kt +++ b/core/src/main/kotlin/plugability/extensions.kt @@ -16,7 +16,7 @@ sealed class OrderingKind { sealed class OverrideKind { object None : OverrideKind() - class Present(val overriden: Extension<*, *, *>) : OverrideKind() + class Present(val overriden: List<Extension<*, *, *>>) : OverrideKind() } class Extension<T : Any, Ordering : OrderingKind, Override : OverrideKind> internal constructor( @@ -68,8 +68,12 @@ class ExtendingDSL(private val pluginClass: String, private val extensionName: S ) = Extension(extensionPoint, pluginClass, extensionName, action, ordering, override, conditions + condition) infix fun <T : Any, Override : OverrideKind, Ordering: OrderingKind> Extension<T, Ordering, Override>.override( - overriden: Extension<T, *, *> + overriden: List<Extension<T, *, *>> ) = Extension(extensionPoint, pluginClass, extensionName, action, ordering, OverrideKind.Present(overriden), conditions) + + infix fun <T : Any, Override : OverrideKind, Ordering: OrderingKind> Extension<T, Ordering, Override>.override( + overriden: Extension<T, *, *> + ) = this.override(listOf(overriden)) } @ExtensionsDsl diff --git a/integration-tests/gradle/src/integrationTest/kotlin/org/jetbrains/dokka/it/gradle/MultiModule0IntegrationTest.kt b/integration-tests/gradle/src/integrationTest/kotlin/org/jetbrains/dokka/it/gradle/MultiModule0IntegrationTest.kt index eedc6da3..47b9620b 100644 --- a/integration-tests/gradle/src/integrationTest/kotlin/org/jetbrains/dokka/it/gradle/MultiModule0IntegrationTest.kt +++ b/integration-tests/gradle/src/integrationTest/kotlin/org/jetbrains/dokka/it/gradle/MultiModule0IntegrationTest.kt @@ -36,12 +36,12 @@ class MultiModule0IntegrationTest(override val versions: BuildVersions) : Abstra assertEquals(TaskOutcome.SUCCESS, assertNotNull(result.task(":moduleA:dokkaHtmlMultiModule")).outcome) assertEquals(TaskOutcome.SUCCESS, assertNotNull(result.task(":moduleA:dokkaGfmMultiModule")).outcome) assertEquals(TaskOutcome.SUCCESS, assertNotNull(result.task(":moduleA:dokkaJekyllMultiModule")).outcome) - assertEquals(TaskOutcome.SUCCESS, assertNotNull(result.task(":moduleA:moduleB:dokkaHtml")).outcome) - assertEquals(TaskOutcome.SUCCESS, assertNotNull(result.task(":moduleA:moduleC:dokkaHtml")).outcome) - assertEquals(TaskOutcome.SUCCESS, assertNotNull(result.task(":moduleA:moduleB:dokkaGfm")).outcome) - assertEquals(TaskOutcome.SUCCESS, assertNotNull(result.task(":moduleA:moduleC:dokkaGfm")).outcome) - assertEquals(TaskOutcome.SUCCESS, assertNotNull(result.task(":moduleA:moduleB:dokkaJekyll")).outcome) - assertEquals(TaskOutcome.SUCCESS, assertNotNull(result.task(":moduleA:moduleC:dokkaJekyll")).outcome) + assertEquals(TaskOutcome.SUCCESS, assertNotNull(result.task(":moduleA:moduleB:dokkaHtmlPartial")).outcome) + assertEquals(TaskOutcome.SUCCESS, assertNotNull(result.task(":moduleA:moduleC:dokkaHtmlPartial")).outcome) + assertEquals(TaskOutcome.SUCCESS, assertNotNull(result.task(":moduleA:moduleB:dokkaGfmPartial")).outcome) + assertEquals(TaskOutcome.SUCCESS, assertNotNull(result.task(":moduleA:moduleC:dokkaGfmPartial")).outcome) + assertEquals(TaskOutcome.SUCCESS, assertNotNull(result.task(":moduleA:moduleB:dokkaJekyllPartial")).outcome) + assertEquals(TaskOutcome.SUCCESS, assertNotNull(result.task(":moduleA:moduleC:dokkaJekyllPartial")).outcome) val outputDir = File(projectDir, "moduleA/build/dokka/htmlMultiModule") @@ -60,8 +60,8 @@ class MultiModule0IntegrationTest(override val versions: BuildVersions) : Abstra assertNoEmptySpans(file) } - val modulesFile = File(outputDir, "-modules.html") - assertTrue(modulesFile.isFile, "Missing -modules.html file") + val modulesFile = File(outputDir, "index.html") + assertTrue(modulesFile.isFile, "Missing index.html file") val modulesFileText = modulesFile.readText() assertTrue( diff --git a/plugins/base/src/test/kotlin/transformers/DivisionSwitchTest.kt b/plugins/base/src/test/kotlin/transformers/DivisionSwitchTest.kt index 58413074..1a2e9fa3 100644 --- a/plugins/base/src/test/kotlin/transformers/DivisionSwitchTest.kt +++ b/plugins/base/src/test/kotlin/transformers/DivisionSwitchTest.kt @@ -8,13 +8,13 @@ import org.jetbrains.dokka.pages.ClasslikePageNode import org.jetbrains.dokka.pages.ContentHeader import org.jetbrains.dokka.pages.ContentNode import org.jetbrains.dokka.pages.ContentText -import org.jetbrains.dokka.testApi.testRunner.AbstractCoreTest +import org.jetbrains.dokka.base.testApi.testRunner.BaseAbstractTest import org.jetbrains.kotlin.utils.addIfNotNull import org.junit.jupiter.api.Test import kotlin.test.assertEquals import kotlin.test.assertNotNull -class DivisionSwitchTest : AbstractCoreTest() { +class DivisionSwitchTest : BaseAbstractTest() { private val query = """ |/src/source0.kt diff --git a/plugins/base/src/test/kotlin/translators/JavadocInheritDocsTest.kt b/plugins/base/src/test/kotlin/translators/JavadocInheritDocsTest.kt index 8fac13c9..4e2cf70f 100644 --- a/plugins/base/src/test/kotlin/translators/JavadocInheritDocsTest.kt +++ b/plugins/base/src/test/kotlin/translators/JavadocInheritDocsTest.kt @@ -4,13 +4,13 @@ import org.jetbrains.dokka.model.doc.CustomDocTag import org.jetbrains.dokka.model.doc.Description import org.jetbrains.dokka.model.doc.P import org.jetbrains.dokka.model.doc.Text -import org.jetbrains.dokka.testApi.testRunner.AbstractCoreTest +import org.jetbrains.dokka.base.testApi.testRunner.BaseAbstractTest import org.junit.Ignore import org.junit.jupiter.api.Assertions.assertEquals import org.junit.jupiter.api.Disabled import org.junit.jupiter.api.Test -class JavadocInheritDocsTest : AbstractCoreTest() { +class JavadocInheritDocsTest : BaseAbstractTest() { val configuration = dokkaConfiguration { sourceSets { sourceSet { diff --git a/plugins/base/src/test/kotlin/translators/JavadocInheritedDocTagsTest.kt b/plugins/base/src/test/kotlin/translators/JavadocInheritedDocTagsTest.kt index a7d4f057..c29c4e96 100644 --- a/plugins/base/src/test/kotlin/translators/JavadocInheritedDocTagsTest.kt +++ b/plugins/base/src/test/kotlin/translators/JavadocInheritedDocTagsTest.kt @@ -4,14 +4,14 @@ import org.jetbrains.dokka.links.DRI import org.jetbrains.dokka.links.PointingToDeclaration import org.jetbrains.dokka.model.DModule import org.jetbrains.dokka.model.doc.* -import org.jetbrains.dokka.testApi.testRunner.AbstractCoreTest +import org.jetbrains.dokka.base.testApi.testRunner.BaseAbstractTest import org.jetbrains.kotlin.utils.addToStdlib.firstIsInstance import org.junit.jupiter.api.Assertions.assertEquals import org.junit.jupiter.api.Test import org.jetbrains.dokka.model.doc.Deprecated as DokkaDeprecatedTag import org.jetbrains.dokka.model.doc.Throws as DokkaThrowsTag -class JavadocInheritedDocTagsTest : AbstractCoreTest() { +class JavadocInheritedDocTagsTest : BaseAbstractTest() { private val configuration = dokkaConfiguration { sourceSets { sourceSet { diff --git a/plugins/gfm/gfm-all-module-page/build.gradle.kts b/plugins/gfm/gfm-all-module-page/build.gradle.kts new file mode 100644 index 00000000..66deb291 --- /dev/null +++ b/plugins/gfm/gfm-all-module-page/build.gradle.kts @@ -0,0 +1,11 @@ +import org.jetbrains.registerDokkaArtifactPublication + +dependencies { + implementation(project(":plugins:base")) + implementation(project(":plugins:gfm")) + implementation(project(":plugins:all-module-page")) +} + +registerDokkaArtifactPublication("dokkaGfmAllModulePage") { + artifactId = "gfm-all-module-page-plugin" +}
\ No newline at end of file diff --git a/plugins/gfm/gfm-all-module-page/src/main/kotlin/org/jetbrains/dokka/gfm/allModulesPage/GfmAllModulesPagaPlugin.kt b/plugins/gfm/gfm-all-module-page/src/main/kotlin/org/jetbrains/dokka/gfm/allModulesPage/GfmAllModulesPagaPlugin.kt new file mode 100644 index 00000000..8052a762 --- /dev/null +++ b/plugins/gfm/gfm-all-module-page/src/main/kotlin/org/jetbrains/dokka/gfm/allModulesPage/GfmAllModulesPagaPlugin.kt @@ -0,0 +1,20 @@ +package org.jetbrains.dokka.gfm.allModulesPage + +import org.jetbrains.dokka.allModulesPage.AllModulesPagePlugin +import org.jetbrains.dokka.base.DokkaBase +import org.jetbrains.dokka.gfm.GfmPlugin +import org.jetbrains.dokka.plugability.DokkaPlugin + +class GfmAllModulesPagePlugin : DokkaPlugin() { + + private val gfmPlugin by lazy { plugin<GfmPlugin>() } + + private val dokkaBase by lazy { plugin<DokkaBase>() } + + private val allModulesPagePlugin by lazy { plugin<AllModulesPagePlugin>() } + + val locationProvider by extending { + (dokkaBase.locationProviderFactory providing GfmMultimoduleLocationProvider::Factory + override listOf(allModulesPagePlugin.multimoduleLocationProvider, gfmPlugin.locationProvider)) + } +}
\ No newline at end of file diff --git a/plugins/gfm/gfm-all-module-page/src/main/kotlin/org/jetbrains/dokka/gfm/allModulesPage/GfmMultimoduleLocationProvider.kt b/plugins/gfm/gfm-all-module-page/src/main/kotlin/org/jetbrains/dokka/gfm/allModulesPage/GfmMultimoduleLocationProvider.kt new file mode 100644 index 00000000..d49be426 --- /dev/null +++ b/plugins/gfm/gfm-all-module-page/src/main/kotlin/org/jetbrains/dokka/gfm/allModulesPage/GfmMultimoduleLocationProvider.kt @@ -0,0 +1,41 @@ +package org.jetbrains.dokka.gfm.allModulesPage + +import org.jetbrains.dokka.base.resolvers.local.DokkaBaseLocationProvider +import org.jetbrains.dokka.base.resolvers.local.DokkaLocationProvider +import org.jetbrains.dokka.base.resolvers.local.LocationProviderFactory +import org.jetbrains.dokka.gfm.location.MarkdownLocationProvider +import org.jetbrains.dokka.links.DRI +import org.jetbrains.dokka.model.DisplaySourceSet +import org.jetbrains.dokka.pages.PageNode +import org.jetbrains.dokka.pages.RootPageNode +import org.jetbrains.dokka.plugability.DokkaContext + +class GfmMultimoduleLocationProvider(private val root: RootPageNode, context: DokkaContext) : DokkaBaseLocationProvider(root, context, ".md") { + + private val defaultLocationProvider = MarkdownLocationProvider(root, context) + + val paths = context.configuration.modules.map { + it.name to it.relativePathToOutputDirectory + }.toMap() + + override fun resolve(dri: DRI, sourceSets: Set<DisplaySourceSet>, context: PageNode?) = + dri.takeIf { it.packageName == MULTIMODULE_PACKAGE_PLACEHOLDER }?.classNames?.let { paths[it] }?.let { + "$it/${DokkaLocationProvider.identifierToFilename(dri.classNames.orEmpty())}/index.md" + } ?: defaultLocationProvider.resolve(dri, sourceSets, context) + + override fun resolve(node: PageNode, context: PageNode?, skipExtension: Boolean) = + defaultLocationProvider.resolve(node, context, skipExtension) + + override fun pathToRoot(from: PageNode): String = defaultLocationProvider.pathToRoot(from) + + override fun ancestors(node: PageNode): List<PageNode> = listOf(root) + + companion object { + const val MULTIMODULE_PACKAGE_PLACEHOLDER = ".ext" + } + + class Factory(private val context: DokkaContext): LocationProviderFactory { + override fun getLocationProvider(pageNode: RootPageNode) = + GfmMultimoduleLocationProvider(pageNode, context) + } +}
\ No newline at end of file diff --git a/plugins/gfm/gfm-all-module-page/src/main/resources/META-INF/services/org.jetbrains.dokka.plugability.DokkaPlugin b/plugins/gfm/gfm-all-module-page/src/main/resources/META-INF/services/org.jetbrains.dokka.plugability.DokkaPlugin new file mode 100644 index 00000000..1a8acd51 --- /dev/null +++ b/plugins/gfm/gfm-all-module-page/src/main/resources/META-INF/services/org.jetbrains.dokka.plugability.DokkaPlugin @@ -0,0 +1 @@ +org.jetbrains.dokka.gfm.allModulesPage.GfmAllModulesPagePlugin
\ No newline at end of file diff --git a/plugins/gfm/src/main/kotlin/org/jetbrains/dokka/gfm/GfmPlugin.kt b/plugins/gfm/src/main/kotlin/org/jetbrains/dokka/gfm/GfmPlugin.kt new file mode 100644 index 00000000..3f2eae4d --- /dev/null +++ b/plugins/gfm/src/main/kotlin/org/jetbrains/dokka/gfm/GfmPlugin.kt @@ -0,0 +1,36 @@ +package org.jetbrains.dokka.gfm + +import org.jetbrains.dokka.CoreExtensions +import org.jetbrains.dokka.base.DokkaBase +import org.jetbrains.dokka.base.renderers.PackageListCreator +import org.jetbrains.dokka.base.renderers.RootCreator +import org.jetbrains.dokka.base.resolvers.shared.RecognizedLinkFormat +import org.jetbrains.dokka.gfm.location.MarkdownLocationProviderFactory +import org.jetbrains.dokka.gfm.renderer.CommonmarkRenderer +import org.jetbrains.dokka.plugability.DokkaPlugin +import org.jetbrains.dokka.transformers.pages.PageTransformer + +class GfmPlugin : DokkaPlugin() { + + val gfmPreprocessors by extensionPoint<PageTransformer>() + + private val dokkaBase by lazy { plugin<DokkaBase>() } + + val renderer by extending { + CoreExtensions.renderer providing ::CommonmarkRenderer override dokkaBase.htmlRenderer + } + + val locationProvider by extending { + dokkaBase.locationProviderFactory providing ::MarkdownLocationProviderFactory override dokkaBase.locationProvider + } + + val rootCreator by extending { + gfmPreprocessors with RootCreator + } + + val packageListCreator by extending { + (gfmPreprocessors + providing { PackageListCreator(it, RecognizedLinkFormat.DokkaGFM) } + order { after(rootCreator) }) + } +} diff --git a/plugins/gfm/src/main/kotlin/org/jetbrains/dokka/gfm/location/MarkdownLocationProvider.kt b/plugins/gfm/src/main/kotlin/org/jetbrains/dokka/gfm/location/MarkdownLocationProvider.kt new file mode 100644 index 00000000..6f96dbd5 --- /dev/null +++ b/plugins/gfm/src/main/kotlin/org/jetbrains/dokka/gfm/location/MarkdownLocationProvider.kt @@ -0,0 +1,16 @@ +package org.jetbrains.dokka.gfm.location + +import org.jetbrains.dokka.base.resolvers.local.DokkaLocationProvider +import org.jetbrains.dokka.base.resolvers.local.LocationProviderFactory +import org.jetbrains.dokka.pages.RootPageNode +import org.jetbrains.dokka.plugability.DokkaContext + +class MarkdownLocationProviderFactory(val context: DokkaContext) : LocationProviderFactory { + override fun getLocationProvider(pageNode: RootPageNode) = MarkdownLocationProvider(pageNode, context) +} + +class MarkdownLocationProvider( + pageGraphRoot: RootPageNode, + dokkaContext: DokkaContext +) : DokkaLocationProvider(pageGraphRoot, dokkaContext, ".md") + diff --git a/plugins/gfm/src/main/kotlin/GfmPlugin.kt b/plugins/gfm/src/main/kotlin/org/jetbrains/dokka/gfm/renderer/CommonmarkRenderer.kt index 780e4cb2..0655ce20 100644 --- a/plugins/gfm/src/main/kotlin/GfmPlugin.kt +++ b/plugins/gfm/src/main/kotlin/org/jetbrains/dokka/gfm/renderer/CommonmarkRenderer.kt @@ -1,52 +1,14 @@ -package org.jetbrains.dokka.gfm +package org.jetbrains.dokka.gfm.renderer -import org.jetbrains.dokka.CoreExtensions -import org.jetbrains.dokka.DokkaConfiguration.DokkaSourceSet import org.jetbrains.dokka.DokkaException -import org.jetbrains.dokka.base.DokkaBase import org.jetbrains.dokka.base.renderers.DefaultRenderer -import org.jetbrains.dokka.base.renderers.PackageListCreator -import org.jetbrains.dokka.base.renderers.RootCreator import org.jetbrains.dokka.base.renderers.isImage -import org.jetbrains.dokka.base.resolvers.local.DokkaLocationProvider -import org.jetbrains.dokka.base.resolvers.local.LocationProviderFactory +import org.jetbrains.dokka.gfm.GfmPlugin import org.jetbrains.dokka.model.DisplaySourceSet -import org.jetbrains.dokka.base.resolvers.shared.RecognizedLinkFormat import org.jetbrains.dokka.pages.* import org.jetbrains.dokka.plugability.DokkaContext -import org.jetbrains.dokka.plugability.DokkaPlugin import org.jetbrains.dokka.plugability.plugin import org.jetbrains.dokka.plugability.query -import org.jetbrains.dokka.transformers.pages.PageTransformer - -class GfmPlugin : DokkaPlugin() { - - val gfmPreprocessors by extensionPoint<PageTransformer>() - - private val dokkaBase by lazy { plugin<DokkaBase>() } - - val renderer by extending { - (CoreExtensions.renderer - providing { CommonmarkRenderer(it) } - override dokkaBase.htmlRenderer) - } - - val locationProvider by extending { - (dokkaBase.locationProviderFactory - providing { MarkdownLocationProviderFactory(it) } - override dokkaBase.locationProvider) - } - - val rootCreator by extending { - gfmPreprocessors with RootCreator - } - - val packageListCreator by extending { - (gfmPreprocessors - providing { PackageListCreator(it, RecognizedLinkFormat.DokkaGFM) } - order { after(rootCreator) }) - } -} open class CommonmarkRenderer( context: DokkaContext @@ -357,14 +319,4 @@ open class CommonmarkRenderer( private fun StringBuilder.buildSourceSetTags(sourceSets: Set<DisplaySourceSet>) = append(sourceSets.joinToString(prefix = "[", postfix = "]") { it.name }) -} - -class MarkdownLocationProviderFactory(val context: DokkaContext) : LocationProviderFactory { - - override fun getLocationProvider(pageNode: RootPageNode) = MarkdownLocationProvider(pageNode, context) -} - -class MarkdownLocationProvider( - pageGraphRoot: RootPageNode, - dokkaContext: DokkaContext -) : DokkaLocationProvider(pageGraphRoot, dokkaContext, ".md") +}
\ No newline at end of file diff --git a/plugins/gfm/src/test/kotlin/renderers/gfm/DivergentTest.kt b/plugins/gfm/src/test/kotlin/renderers/gfm/DivergentTest.kt index a205aa2f..b0eead1b 100644 --- a/plugins/gfm/src/test/kotlin/renderers/gfm/DivergentTest.kt +++ b/plugins/gfm/src/test/kotlin/renderers/gfm/DivergentTest.kt @@ -2,7 +2,7 @@ package renderers.gfm import org.jetbrains.dokka.DokkaSourceSetID import org.jetbrains.dokka.Platform -import org.jetbrains.dokka.gfm.CommonmarkRenderer +import org.jetbrains.dokka.gfm.renderer.CommonmarkRenderer import org.jetbrains.dokka.links.DRI import org.jetbrains.dokka.pages.ContentDivergentGroup import org.junit.jupiter.api.Test diff --git a/plugins/gfm/src/test/kotlin/renderers/gfm/GfmRenderingOnlyTestBase.kt b/plugins/gfm/src/test/kotlin/renderers/gfm/GfmRenderingOnlyTestBase.kt index a118a20e..165aef98 100644 --- a/plugins/gfm/src/test/kotlin/renderers/gfm/GfmRenderingOnlyTestBase.kt +++ b/plugins/gfm/src/test/kotlin/renderers/gfm/GfmRenderingOnlyTestBase.kt @@ -2,7 +2,7 @@ package renderers.gfm import org.jetbrains.dokka.DokkaConfigurationImpl import org.jetbrains.dokka.gfm.GfmPlugin -import org.jetbrains.dokka.gfm.MarkdownLocationProviderFactory +import org.jetbrains.dokka.gfm.location.MarkdownLocationProviderFactory import org.jetbrains.dokka.testApi.context.MockContext import org.jetbrains.dokka.base.DokkaBase import org.jetbrains.dokka.base.renderers.RootCreator diff --git a/plugins/gfm/src/test/kotlin/renderers/gfm/GroupWrappingTest.kt b/plugins/gfm/src/test/kotlin/renderers/gfm/GroupWrappingTest.kt index 53bee558..93aee5e1 100644 --- a/plugins/gfm/src/test/kotlin/renderers/gfm/GroupWrappingTest.kt +++ b/plugins/gfm/src/test/kotlin/renderers/gfm/GroupWrappingTest.kt @@ -1,6 +1,6 @@ package renderers.gfm -import org.jetbrains.dokka.gfm.CommonmarkRenderer +import org.jetbrains.dokka.gfm.renderer.CommonmarkRenderer import org.jetbrains.dokka.pages.TextStyle import org.junit.jupiter.api.Test import renderers.* diff --git a/plugins/gfm/src/test/kotlin/renderers/gfm/SimpleElementsTest.kt b/plugins/gfm/src/test/kotlin/renderers/gfm/SimpleElementsTest.kt index 9055fbc3..7b887071 100644 --- a/plugins/gfm/src/test/kotlin/renderers/gfm/SimpleElementsTest.kt +++ b/plugins/gfm/src/test/kotlin/renderers/gfm/SimpleElementsTest.kt @@ -1,6 +1,6 @@ package renderers.gfm -import org.jetbrains.dokka.gfm.CommonmarkRenderer +import org.jetbrains.dokka.gfm.renderer.CommonmarkRenderer import org.junit.jupiter.api.Test import renderers.testPage import org.jetbrains.dokka.links.DRI diff --git a/plugins/gfm/src/test/kotlin/renderers/gfm/SourceSetDependentHintTest.kt b/plugins/gfm/src/test/kotlin/renderers/gfm/SourceSetDependentHintTest.kt index 0d845a98..4d05c602 100644 --- a/plugins/gfm/src/test/kotlin/renderers/gfm/SourceSetDependentHintTest.kt +++ b/plugins/gfm/src/test/kotlin/renderers/gfm/SourceSetDependentHintTest.kt @@ -2,7 +2,7 @@ package renderers.gfm import org.jetbrains.dokka.DokkaSourceSetID import org.jetbrains.dokka.Platform -import org.jetbrains.dokka.gfm.CommonmarkRenderer +import org.jetbrains.dokka.gfm.renderer.CommonmarkRenderer import org.jetbrains.dokka.pages.TextStyle import org.junit.jupiter.api.Test import renderers.testPage diff --git a/plugins/jekyll/src/main/kotlin/JekyllPlugin.kt b/plugins/jekyll/src/main/kotlin/JekyllPlugin.kt index 81a49812..dfe3226a 100644 --- a/plugins/jekyll/src/main/kotlin/JekyllPlugin.kt +++ b/plugins/jekyll/src/main/kotlin/JekyllPlugin.kt @@ -1,11 +1,10 @@ package org.jetbrains.dokka.jekyll import org.jetbrains.dokka.CoreExtensions -import org.jetbrains.dokka.base.DokkaBase import org.jetbrains.dokka.base.renderers.PackageListCreator import org.jetbrains.dokka.base.renderers.RootCreator import org.jetbrains.dokka.base.resolvers.shared.RecognizedLinkFormat -import org.jetbrains.dokka.gfm.CommonmarkRenderer +import org.jetbrains.dokka.gfm.renderer.CommonmarkRenderer import org.jetbrains.dokka.gfm.GfmPlugin import org.jetbrains.dokka.pages.* import org.jetbrains.dokka.plugability.DokkaContext diff --git a/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/DokkaArtifacts.kt b/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/DokkaArtifacts.kt index 726dd950..cca1b3f8 100644 --- a/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/DokkaArtifacts.kt +++ b/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/DokkaArtifacts.kt @@ -14,5 +14,6 @@ internal class DokkaArtifacts(private val project: Project) { val dokkaBase get() = fromModuleName("dokka-base") val javadocPlugin get() = fromModuleName("javadoc-plugin") val gfmPlugin get() = fromModuleName("gfm-plugin") + val gfmAllModulesPagePlugin get() = fromModuleName("gfm-all-module-page-plugin") val jekyllPlugin get() = fromModuleName("jekyll-plugin") } diff --git a/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/main.kt b/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/main.kt index 99e6e7e3..3c89100e 100644 --- a/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/main.kt +++ b/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/main.kt @@ -3,6 +3,7 @@ package org.jetbrains.dokka.gradle import org.gradle.api.DefaultTask import org.gradle.api.Plugin import org.gradle.api.Project +import org.gradle.api.artifacts.Dependency import org.gradle.kotlin.dsl.register open class DokkaPlugin : Plugin<Project> { @@ -20,12 +21,12 @@ open class DokkaPlugin : Plugin<Project> { description = "Generates documentation in 'javadoc' format" } - project.setupDokkaTasks("dokkaGfm") { + project.setupDokkaTasks("dokkaGfm", allModulesPage = project.dokkaArtifacts.gfmAllModulesPagePlugin) { plugins.dependencies.add(project.dokkaArtifacts.gfmPlugin) description = "Generates documentation in GitHub flavored markdown format" } - project.setupDokkaTasks("dokkaJekyll") { + project.setupDokkaTasks("dokkaJekyll", allModulesPage = project.dokkaArtifacts.gfmAllModulesPagePlugin) { plugins.dependencies.add(project.dokkaArtifacts.jekyllPlugin) description = "Generates documentation in Jekyll flavored markdown format" } @@ -38,6 +39,7 @@ open class DokkaPlugin : Plugin<Project> { private fun Project.setupDokkaTasks( name: String, multiModuleTaskSupported: Boolean = true, + allModulesPage: Dependency = project.dokkaArtifacts.allModulesPage, collectorTaskSupported: Boolean = true, configuration: AbstractDokkaTask.() -> Unit = {} ) { @@ -63,7 +65,7 @@ open class DokkaPlugin : Plugin<Project> { addSubprojectChildTasks("${name}Partial") configuration() description = "Runs all subprojects '$name' tasks and generates module navigation page" - plugins.dependencies.add(project.dokkaArtifacts.allModulesPage) + plugins.dependencies.add(allModulesPage) } project.tasks.register<DefaultTask>("${name}Multimodule") { diff --git a/settings.gradle.kts b/settings.gradle.kts index 52b16dc3..61c81433 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -20,6 +20,7 @@ include("plugins:all-module-page") include("plugins:mathjax") include("plugins:gfm") +include("plugins:gfm:gfm-all-module-page") include("plugins:jekyll") include("plugins:kotlin-as-java") include("plugins:javadoc") |