From a673f77482fea4ba89f9fdf3a7544955cf8b8226 Mon Sep 17 00:00:00 2001 From: Błażej Kardyś Date: Wed, 29 Jul 2020 19:34:12 +0200 Subject: Javadoc plugin package name fix --- .../javadoc/JavadocDocumentableToPageTranslator.kt | 18 - .../src/main/kotlin/javadoc/JavadocPageCreator.kt | 238 ----------- .../src/main/kotlin/javadoc/JavadocPlugin.kt | 53 --- .../javadoc/location/JavadocLocationProvider.kt | 129 ------ .../location/JavadocLocationProviderFactory.kt | 11 - .../kotlin/javadoc/pages/JavadocContentNodes.kt | 173 -------- .../main/kotlin/javadoc/pages/JavadocIndexExtra.kt | 10 - .../main/kotlin/javadoc/pages/JavadocPageNodes.kt | 436 --------------------- .../main/kotlin/javadoc/pages/htmlPreprocessors.kt | 68 ---- .../javadoc/src/main/kotlin/javadoc/pages/pages.kt | 17 - .../renderer/JavadocContentToHtmlTranslator.kt | 63 --- .../JavadocContentToTemplateMapTranslator.kt | 222 ----------- .../javadoc/renderer/KorteJavadocRenderer.kt | 190 --------- .../javadoc/renderer/SearchScriptsCreator.kt | 261 ------------ .../javadoc/signatures/JavadocSignatureProvider.kt | 201 ---------- .../documentables/JavadocPageContentBuilder.kt | 80 ---- plugins/javadoc/src/main/kotlin/javadoc/utils.kt | 8 - .../javadoc/JavadocDocumentableToPageTranslator.kt | 18 + .../jetbrains/dokka/javadoc/JavadocPageCreator.kt | 238 +++++++++++ .../org/jetbrains/dokka/javadoc/JavadocPlugin.kt | 53 +++ .../javadoc/location/JavadocLocationProvider.kt | 129 ++++++ .../location/JavadocLocationProviderFactory.kt | 11 + .../dokka/javadoc/pages/JavadocContentNodes.kt | 173 ++++++++ .../dokka/javadoc/pages/JavadocIndexExtra.kt | 10 + .../dokka/javadoc/pages/JavadocPageNodes.kt | 436 +++++++++++++++++++++ .../dokka/javadoc/pages/htmlPreprocessors.kt | 68 ++++ .../org/jetbrains/dokka/javadoc/pages/pages.kt | 17 + .../renderer/JavadocContentToHtmlTranslator.kt | 63 +++ .../JavadocContentToTemplateMapTranslator.kt | 222 +++++++++++ .../dokka/javadoc/renderer/KorteJavadocRenderer.kt | 190 +++++++++ .../dokka/javadoc/renderer/SearchScriptsCreator.kt | 261 ++++++++++++ .../javadoc/signatures/JavadocSignatureProvider.kt | 201 ++++++++++ .../documentables/JavadocPageContentBuilder.kt | 80 ++++ .../kotlin/org/jetbrains/dokka/javadoc/utils.kt | 8 + 34 files changed, 2178 insertions(+), 2178 deletions(-) delete mode 100644 plugins/javadoc/src/main/kotlin/javadoc/JavadocDocumentableToPageTranslator.kt delete mode 100644 plugins/javadoc/src/main/kotlin/javadoc/JavadocPageCreator.kt delete mode 100644 plugins/javadoc/src/main/kotlin/javadoc/JavadocPlugin.kt delete mode 100644 plugins/javadoc/src/main/kotlin/javadoc/location/JavadocLocationProvider.kt delete mode 100644 plugins/javadoc/src/main/kotlin/javadoc/location/JavadocLocationProviderFactory.kt delete mode 100644 plugins/javadoc/src/main/kotlin/javadoc/pages/JavadocContentNodes.kt delete mode 100644 plugins/javadoc/src/main/kotlin/javadoc/pages/JavadocIndexExtra.kt delete mode 100644 plugins/javadoc/src/main/kotlin/javadoc/pages/JavadocPageNodes.kt delete mode 100644 plugins/javadoc/src/main/kotlin/javadoc/pages/htmlPreprocessors.kt delete mode 100644 plugins/javadoc/src/main/kotlin/javadoc/pages/pages.kt delete mode 100644 plugins/javadoc/src/main/kotlin/javadoc/renderer/JavadocContentToHtmlTranslator.kt delete mode 100644 plugins/javadoc/src/main/kotlin/javadoc/renderer/JavadocContentToTemplateMapTranslator.kt delete mode 100644 plugins/javadoc/src/main/kotlin/javadoc/renderer/KorteJavadocRenderer.kt delete mode 100644 plugins/javadoc/src/main/kotlin/javadoc/renderer/SearchScriptsCreator.kt delete mode 100644 plugins/javadoc/src/main/kotlin/javadoc/signatures/JavadocSignatureProvider.kt delete mode 100644 plugins/javadoc/src/main/kotlin/javadoc/translators/documentables/JavadocPageContentBuilder.kt delete mode 100644 plugins/javadoc/src/main/kotlin/javadoc/utils.kt create mode 100644 plugins/javadoc/src/main/kotlin/org/jetbrains/dokka/javadoc/JavadocDocumentableToPageTranslator.kt create mode 100644 plugins/javadoc/src/main/kotlin/org/jetbrains/dokka/javadoc/JavadocPageCreator.kt create mode 100644 plugins/javadoc/src/main/kotlin/org/jetbrains/dokka/javadoc/JavadocPlugin.kt create mode 100644 plugins/javadoc/src/main/kotlin/org/jetbrains/dokka/javadoc/location/JavadocLocationProvider.kt create mode 100644 plugins/javadoc/src/main/kotlin/org/jetbrains/dokka/javadoc/location/JavadocLocationProviderFactory.kt create mode 100644 plugins/javadoc/src/main/kotlin/org/jetbrains/dokka/javadoc/pages/JavadocContentNodes.kt create mode 100644 plugins/javadoc/src/main/kotlin/org/jetbrains/dokka/javadoc/pages/JavadocIndexExtra.kt create mode 100644 plugins/javadoc/src/main/kotlin/org/jetbrains/dokka/javadoc/pages/JavadocPageNodes.kt create mode 100644 plugins/javadoc/src/main/kotlin/org/jetbrains/dokka/javadoc/pages/htmlPreprocessors.kt create mode 100644 plugins/javadoc/src/main/kotlin/org/jetbrains/dokka/javadoc/pages/pages.kt create mode 100644 plugins/javadoc/src/main/kotlin/org/jetbrains/dokka/javadoc/renderer/JavadocContentToHtmlTranslator.kt create mode 100644 plugins/javadoc/src/main/kotlin/org/jetbrains/dokka/javadoc/renderer/JavadocContentToTemplateMapTranslator.kt create mode 100644 plugins/javadoc/src/main/kotlin/org/jetbrains/dokka/javadoc/renderer/KorteJavadocRenderer.kt create mode 100644 plugins/javadoc/src/main/kotlin/org/jetbrains/dokka/javadoc/renderer/SearchScriptsCreator.kt create mode 100644 plugins/javadoc/src/main/kotlin/org/jetbrains/dokka/javadoc/signatures/JavadocSignatureProvider.kt create mode 100644 plugins/javadoc/src/main/kotlin/org/jetbrains/dokka/javadoc/translators/documentables/JavadocPageContentBuilder.kt create mode 100644 plugins/javadoc/src/main/kotlin/org/jetbrains/dokka/javadoc/utils.kt (limited to 'plugins/javadoc/src/main') diff --git a/plugins/javadoc/src/main/kotlin/javadoc/JavadocDocumentableToPageTranslator.kt b/plugins/javadoc/src/main/kotlin/javadoc/JavadocDocumentableToPageTranslator.kt deleted file mode 100644 index 840bdc55..00000000 --- a/plugins/javadoc/src/main/kotlin/javadoc/JavadocDocumentableToPageTranslator.kt +++ /dev/null @@ -1,18 +0,0 @@ -package javadoc - -import org.jetbrains.dokka.base.signatures.SignatureProvider -import org.jetbrains.dokka.base.transformers.pages.comments.CommentsToContentConverter -import org.jetbrains.dokka.model.DModule -import org.jetbrains.dokka.pages.ModulePageNode -import org.jetbrains.dokka.pages.RootPageNode -import org.jetbrains.dokka.transformers.documentation.DocumentableToPageTranslator -import org.jetbrains.dokka.utilities.DokkaLogger - -class JavadocDocumentableToPageTranslator( - private val commentsToContentConverter: CommentsToContentConverter, - private val signatureProvider: SignatureProvider, - private val logger: DokkaLogger -) : DocumentableToPageTranslator { - override fun invoke(module: DModule): RootPageNode = - JavadocPageCreator(commentsToContentConverter, signatureProvider, logger).pageForModule(module) -} \ No newline at end of file diff --git a/plugins/javadoc/src/main/kotlin/javadoc/JavadocPageCreator.kt b/plugins/javadoc/src/main/kotlin/javadoc/JavadocPageCreator.kt deleted file mode 100644 index 7420f78e..00000000 --- a/plugins/javadoc/src/main/kotlin/javadoc/JavadocPageCreator.kt +++ /dev/null @@ -1,238 +0,0 @@ -package javadoc - -import javadoc.pages.* -import org.jetbrains.dokka.DokkaConfiguration.DokkaSourceSet -import org.jetbrains.dokka.Platform -import org.jetbrains.dokka.base.signatures.SignatureProvider -import org.jetbrains.dokka.base.transformers.pages.comments.CommentsToContentConverter -import org.jetbrains.dokka.base.transformers.pages.comments.DocTagToContentConverter -import org.jetbrains.dokka.model.* -import org.jetbrains.dokka.model.doc.Description -import org.jetbrains.dokka.model.doc.Index -import org.jetbrains.dokka.model.doc.Param -import org.jetbrains.dokka.model.doc.TagWrapper -import org.jetbrains.dokka.model.properties.PropertyContainer -import org.jetbrains.dokka.model.properties.WithExtraProperties -import org.jetbrains.dokka.pages.* -import org.jetbrains.dokka.utilities.DokkaLogger -import kotlin.reflect.KClass - -open class JavadocPageCreator( - commentsToContentConverter: CommentsToContentConverter, - private val signatureProvider: SignatureProvider, - val logger: DokkaLogger -) { - - fun pageForModule(m: DModule): JavadocModulePageNode = - JavadocModulePageNode( - name = m.name.ifEmpty { "root" }, - content = contentForModule(m), - children = m.packages.map { pageForPackage(it) }, - dri = setOf(m.dri) - ) - - fun pageForPackage(p: DPackage) = - JavadocPackagePageNode(p.name, contentForPackage(p), setOf(p.dri), p, - p.classlikes.mapNotNull { pageForClasslike(it) } // TODO: nested classlikes - ) - - fun pageForClasslike(c: DClasslike): JavadocClasslikePageNode? = - c.highestJvmSourceSet?.let { jvm -> - JavadocClasslikePageNode( - name = c.name.orEmpty(), - content = contentForClasslike(c), - dri = setOf(c.dri), - signature = signatureForNode(c, jvm), - description = c.descriptionToContentNodes(), - constructors = (c as? WithConstructors)?.constructors?.mapNotNull { it.toJavadocFunction() }.orEmpty(), - methods = c.functions.mapNotNull { it.toJavadocFunction() }, - entries = (c as? DEnum)?.entries?.map { - JavadocEntryNode( - it.dri, - it.name, - signatureForNode(it, jvm), - it.descriptionToContentNodes(jvm), - PropertyContainer.withAll(it.indexesInDocumentation()) - ) - }.orEmpty(), - classlikes = c.classlikes.mapNotNull { pageForClasslike(it) }, - properties = c.properties.map { - JavadocPropertyNode( - it.dri, - it.name, - signatureForNode(it, jvm), - it.descriptionToContentNodes(jvm), - PropertyContainer.withAll(it.indexesInDocumentation()) - ) - }, - documentable = c, - extra = ((c as? WithExtraProperties)?.extra ?: PropertyContainer.empty()) + c.indexesInDocumentation() - ) - } - - private fun contentForModule(m: DModule): JavadocContentNode = - JavadocContentGroup( - setOf(m.dri), - JavadocContentKind.OverviewSummary, - m.jvmSourceSets.toSet() - ) { - title(m.name, m.brief(), "0.0.1", dri = setOf(m.dri), kind = ContentKind.Main) - leafList(setOf(m.dri), - ContentKind.Packages, JavadocList( - "Packages", "Package", - m.packages.sortedBy { it.name }.map { p -> - RowJavadocListEntry( - LinkJavadocListEntry(p.name, setOf(p.dri), JavadocContentKind.PackageSummary, sourceSets), - p.brief() - ) - } - )) - } - - private fun contentForPackage(p: DPackage): JavadocContentNode = - JavadocContentGroup( - setOf(p.dri), - JavadocContentKind.PackageSummary, - p.jvmSourceSets.toSet() - ) { - title(p.name, p.brief(), "0.0.1", dri = setOf(p.dri), kind = ContentKind.Packages) - val rootList = p.classlikes.groupBy { it::class }.map { (key, value) -> - JavadocList(key.tabTitle, key.colTitle, value.map { c -> - RowJavadocListEntry( - LinkJavadocListEntry(c.name ?: "", setOf(c.dri), JavadocContentKind.Class, sourceSets), - c.brief() - ) - }) - } - rootList(setOf(p.dri), JavadocContentKind.Class, rootList) - } - - private val KClass.colTitle: String - get() = when(this) { - DClass::class -> "Class" - DObject::class -> "Object" - DAnnotation::class -> "Annotation" - DEnum::class -> "Enum" - DInterface::class -> "Interface" - else -> "" - } - - private val KClass.tabTitle: String - get() = "$colTitle Summary" - - private fun contentForClasslike(c: DClasslike): JavadocContentNode = - JavadocContentGroup( - setOf(c.dri), - JavadocContentKind.Class, - c.jvmSourceSets.toSet() - ) { - title( - c.name.orEmpty(), - c.brief(), - "0.0.1", - parent = c.dri.packageName, - dri = setOf(c.dri), - kind = JavadocContentKind.Class - ) - } - - private fun DFunction.toJavadocFunction() = highestJvmSourceSet?.let { jvm -> - JavadocFunctionNode( - name = name, - dri = dri, - signature = signatureForNode(this, jvm), - brief = brief(jvm), - parameters = parameters.mapNotNull { - val signature = signatureForNode(it, jvm) - signature.modifiers?.let { type -> - JavadocParameterNode( - name = it.name.orEmpty(), - type = type, - description = it.brief(), - typeBound = it.type, - dri = it.dri, - extra = PropertyContainer.withAll(it.indexesInDocumentation()) - ) - } - }, - extra = extra + indexesInDocumentation() - ) - } - - private val Documentable.jvmSourceSets - get() = sourceSets.filter { it.analysisPlatform == Platform.jvm } - - private val Documentable.highestJvmSourceSet - get() = jvmSourceSets.let { sources -> - sources.firstOrNull { it != expectPresentInSet } ?: sources.firstOrNull() - } - - private val firstSentenceRegex = Regex("^((?:[^.?!]|[.!?](?!\\s))*[.!?])") - - private inline fun Documentable.findNodeInDocumentation(sourceSetData: DokkaSourceSet?): T? = - documentation[sourceSetData]?.firstChildOfTypeOrNull() - - private fun Documentable.descriptionToContentNodes(sourceSet: DokkaSourceSet? = highestJvmSourceSet) = - contentNodesFromType(sourceSet) - - private fun DParameter.paramsToContentNodes(sourceSet: DokkaSourceSet? = highestJvmSourceSet) = - contentNodesFromType(sourceSet) - - private inline fun Documentable.contentNodesFromType(sourceSet: DokkaSourceSet?) = - findNodeInDocumentation(sourceSet)?.let { - DocTagToContentConverter.buildContent( - it.root, - DCI(setOf(dri), JavadocContentKind.OverviewSummary), - sourceSets.toSet() - ) - }.orEmpty() - - fun List.nodeForJvm(jvm: DokkaSourceSet): ContentNode = - first { it.sourceSets.contains(jvm) } - - private fun Documentable.brief(sourceSet: DokkaSourceSet? = highestJvmSourceSet): List = - briefFromContentNodes(descriptionToContentNodes(sourceSet)) - - private fun briefFromContentNodes(description: List): List { - val contents = mutableListOf() - for (node in description) { - if (node is ContentText && firstSentenceRegex.containsMatchIn(node.text)) { - contents.add(node.copy(text = firstSentenceRegex.find(node.text)?.value.orEmpty())) - break - } else { - contents.add(node) - } - } - return contents - } - - private fun DParameter.brief(sourceSet: DokkaSourceSet? = highestJvmSourceSet): List = - briefFromContentNodes(paramsToContentNodes(sourceSet).dropWhile { it is ContentDRILink }) - - private fun ContentNode.asJavadocNode(): JavadocSignatureContentNode = - (this as ContentGroup).firstChildOfTypeOrNull() - ?: throw IllegalStateException("No content for javadoc signature found") - - private fun signatureForNode(documentable: Documentable, sourceSet: DokkaSourceSet): JavadocSignatureContentNode = - signatureProvider.signature(documentable).nodeForJvm(sourceSet).asJavadocNode() - - private fun Documentable.indexesInDocumentation(): JavadocIndexExtra { - val indexes = documentation[highestJvmSourceSet]?.withDescendants()?.filterIsInstance()?.toList().orEmpty() - return JavadocIndexExtra( - indexes.map { - ContentGroup( - children = DocTagToContentConverter.buildContent( - it, - DCI(setOf(dri), JavadocContentKind.OverviewSummary), - sourceSets.toSet() - ), - dci = DCI(setOf(dri), JavadocContentKind.OverviewSummary), - sourceSets = sourceSets.toSet(), - style = emptySet(), - extra = PropertyContainer.empty() - ) - } - ) - } -} - diff --git a/plugins/javadoc/src/main/kotlin/javadoc/JavadocPlugin.kt b/plugins/javadoc/src/main/kotlin/javadoc/JavadocPlugin.kt deleted file mode 100644 index 8283bd78..00000000 --- a/plugins/javadoc/src/main/kotlin/javadoc/JavadocPlugin.kt +++ /dev/null @@ -1,53 +0,0 @@ -package org.jetbrains.dokka.javadoc - -import javadoc.JavadocDocumentableToPageTranslator -import javadoc.location.JavadocLocationProviderFactory -import javadoc.renderer.KorteJavadocRenderer -import javadoc.signatures.JavadocSignatureProvider -import org.jetbrains.dokka.CoreExtensions -import org.jetbrains.dokka.base.DokkaBase -import org.jetbrains.dokka.kotlinAsJava.KotlinAsJavaPlugin -import org.jetbrains.dokka.plugability.DokkaPlugin -import org.jetbrains.dokka.plugability.querySingle - -class JavadocPlugin : DokkaPlugin() { - - val dokkaBasePlugin by lazy { plugin() } - val kotinAsJavaPlugin by lazy { plugin() } - - val locationProviderFactory by extensionPoint() - - val dokkaJavadocPlugin by extending { - (CoreExtensions.renderer - providing { ctx -> KorteJavadocRenderer(dokkaBasePlugin.querySingle { outputWriter }, ctx, "views") } - override dokkaBasePlugin.htmlRenderer) - } - - val pageTranslator by extending { - CoreExtensions.documentableToPageTranslator providing { context -> - JavadocDocumentableToPageTranslator( - dokkaBasePlugin.querySingle { commentsToContentConverter }, - dokkaBasePlugin.querySingle { signatureProvider }, - context.logger - ) - } override dokkaBasePlugin.documentableToPageTranslator - } - - val javadocLocationProviderFactory by extending { - locationProviderFactory providing { context -> - JavadocLocationProviderFactory(context) - } - } - - val javadocSignatureProvider by extending { - val dokkaBasePlugin = plugin() - dokkaBasePlugin.signatureProvider providing { ctx -> - JavadocSignatureProvider( - ctx.single( - dokkaBasePlugin.commentsToContentConverter - ), ctx.logger - ) - } override kotinAsJavaPlugin.javaSignatureProvider - } -} - diff --git a/plugins/javadoc/src/main/kotlin/javadoc/location/JavadocLocationProvider.kt b/plugins/javadoc/src/main/kotlin/javadoc/location/JavadocLocationProvider.kt deleted file mode 100644 index 0ce20c78..00000000 --- a/plugins/javadoc/src/main/kotlin/javadoc/location/JavadocLocationProvider.kt +++ /dev/null @@ -1,129 +0,0 @@ -package javadoc.location - -import javadoc.pages.* -import org.jetbrains.dokka.DokkaConfiguration.DokkaSourceSet -import org.jetbrains.dokka.base.resolvers.local.BaseLocationProvider -import org.jetbrains.dokka.links.DRI -import org.jetbrains.dokka.links.Nullable -import org.jetbrains.dokka.links.parent -import org.jetbrains.dokka.model.* -import org.jetbrains.dokka.pages.ContentPage -import org.jetbrains.dokka.pages.PageNode -import org.jetbrains.dokka.pages.RootPageNode -import org.jetbrains.dokka.plugability.DokkaContext -import java.util.* - -class JavadocLocationProvider(pageRoot: RootPageNode, dokkaContext: DokkaContext) : - BaseLocationProvider(dokkaContext) { - - private val pathIndex = IdentityHashMap>().apply { - fun registerPath(page: PageNode, prefix: List = emptyList()) { - val packagePath = page.takeIf { it is JavadocPackagePageNode }?.name.orEmpty() - .replace(".", "/") - val newPathPrefix = prefix + packagePath - - val path = (prefix + when (page) { - is AllClassesPage -> listOf("allclasses") - is TreeViewPage -> if (page.classes == null) - listOf("overview-tree") - else - listOf("package-tree") - is ContentPage -> if (page.dri.isNotEmpty() && page.dri.first().classNames != null) - listOfNotNull(page.dri.first().classNames) - else if (page is JavadocPackagePageNode) - listOf(packagePath, "package-summary") - else - listOf("index") - else -> emptyList() - }).filterNot { it.isEmpty() } - - put(page, path) - page.children.forEach { registerPath(it, newPathPrefix) } - - } - put(pageRoot, listOf("index")) - pageRoot.children.forEach { registerPath(it) } - } - - private val nodeIndex = HashMap().apply { - fun registerNode(node: PageNode) { - if (node is ContentPage) put(node.dri.first(), node) - node.children.forEach(::registerNode) - } - registerNode(pageRoot) - } - - private operator fun IdentityHashMap>.get(dri: DRI) = this[nodeIndex[dri]] - - private fun List.relativeTo(context: List): String { - val contextPath = context.dropLast(1) - val commonPathElements = zip(contextPath).takeWhile { (a, b) -> a == b }.count() - return (List(contextPath.size - commonPathElements) { ".." } + this.drop(commonPathElements)).joinToString("/") - } - - private fun JavadocClasslikePageNode.findAnchorableByDRI(dri: DRI): AnchorableJavadocNode? = - (constructors + methods + entries + properties).firstOrNull { it.dri == dri } - - override fun resolve(dri: DRI, sourceSets: Set, context: PageNode?): String { - return nodeIndex[dri]?.let { resolve(it, context) } - ?: nodeIndex[dri.parent]?.let { - val anchor = when (val anchorElement = (it as? JavadocClasslikePageNode)?.findAnchorableByDRI(dri)) { - is JavadocFunctionNode -> anchorElement.getAnchor() - is JavadocEntryNode -> anchorElement.name - is JavadocPropertyNode -> anchorElement.name - else -> anchorForDri(dri) - } - "${resolve(it, context, skipExtension = true)}.html#$anchor" - } - ?: getExternalLocation(dri, sourceSets) - } - - private fun JavadocFunctionNode.getAnchor(): String = - "$name(${parameters.joinToString(",") { - when (val bound = if (it.typeBound is org.jetbrains.dokka.model.Nullable) it.typeBound.inner else it.typeBound) { - is TypeConstructor -> bound.dri.classNames.orEmpty() - is OtherParameter -> bound.name - is PrimitiveJavaType -> bound.name - is UnresolvedBound -> bound.name - is JavaObject -> "Object" - else -> bound.toString() - } - }})" - - fun anchorForFunctionNode(node: JavadocFunctionNode) = node.getAnchor() - - private fun anchorForDri(dri: DRI): String = - dri.callable?.let { callable -> - "${callable.name}(${callable.params.joinToString(",") { - ((it as? Nullable)?.wrapped ?: it).toString() - }})" - } ?: dri.classNames.orEmpty() - - override fun resolve(node: PageNode, context: PageNode?, skipExtension: Boolean): String = - pathIndex[node]?.relativeTo(pathIndex[context].orEmpty())?.let { - if (skipExtension) it.removeSuffix(".html") else it - } ?: run { - throw IllegalStateException("Path for ${node::class.java.canonicalName}:${node.name} not found") - } - - fun resolve(link: LinkJavadocListEntry, contextRoot: PageNode? = null, skipExtension: Boolean = true) = - pathIndex[link.dri.first()]?.let { - when (link.kind) { - JavadocContentKind.Class -> it - JavadocContentKind.OverviewSummary -> it.dropLast(1) + "index" - JavadocContentKind.PackageSummary -> it.dropLast(1) + "package-summary" - JavadocContentKind.AllClasses -> it.dropLast(1) + "allclasses" - JavadocContentKind.OverviewTree -> it.dropLast(1) + "overview-tree" - JavadocContentKind.PackageTree -> it.dropLast(1) + "package-tree" - else -> it - } - }?.relativeTo(pathIndex[contextRoot].orEmpty())?.let { if (skipExtension) "$it.html" else it }.orEmpty() - - override fun resolveRoot(node: PageNode): String { - TODO("Not yet implemented") - } - - override fun ancestors(node: PageNode): List { - TODO("Not yet implemented") - } -} diff --git a/plugins/javadoc/src/main/kotlin/javadoc/location/JavadocLocationProviderFactory.kt b/plugins/javadoc/src/main/kotlin/javadoc/location/JavadocLocationProviderFactory.kt deleted file mode 100644 index b6bfb48d..00000000 --- a/plugins/javadoc/src/main/kotlin/javadoc/location/JavadocLocationProviderFactory.kt +++ /dev/null @@ -1,11 +0,0 @@ -package javadoc.location - -import org.jetbrains.dokka.base.resolvers.local.LocationProviderFactory -import org.jetbrains.dokka.pages.RootPageNode -import org.jetbrains.dokka.plugability.DokkaContext - -class JavadocLocationProviderFactory(private val context: DokkaContext) : LocationProviderFactory { - - override fun getLocationProvider(pageNode: RootPageNode) = - JavadocLocationProvider(pageNode, context) -} \ No newline at end of file diff --git a/plugins/javadoc/src/main/kotlin/javadoc/pages/JavadocContentNodes.kt b/plugins/javadoc/src/main/kotlin/javadoc/pages/JavadocContentNodes.kt deleted file mode 100644 index d83704a6..00000000 --- a/plugins/javadoc/src/main/kotlin/javadoc/pages/JavadocContentNodes.kt +++ /dev/null @@ -1,173 +0,0 @@ -package javadoc.pages - -import org.jetbrains.dokka.links.DRI -import org.jetbrains.dokka.DokkaConfiguration.DokkaSourceSet -import org.jetbrains.dokka.model.properties.PropertyContainer -import org.jetbrains.dokka.pages.* - -enum class JavadocContentKind : Kind { - AllClasses, OverviewSummary, PackageSummary, Class, OverviewTree, PackageTree -} - -abstract class JavadocContentNode( - dri: Set, - kind: Kind, - override val sourceSets: Set -) : ContentNode { - override val dci: DCI = DCI(dri, kind) - override val style: Set