You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a project with many subproject. The root project hosts the entrypoint of the entire application.
When generating documentation for the root project, if no subproject is added through dependency, only the local module's documentation is produced (as expected).
When, instead,
Links on the right work correctly, links in the left bar are broken.
To Reproduce
Create a mutlimodule project
Apply dokka
add sources to the root project and to the subprojects
Enable dokka v2
run dokkaGenerate
Dokka configuration
The following is my convention plugin for dokka. Looks complicated , but all the complexity is just linking source from GitHub and linking libraries from javadoc.io.
importUtil.currentCommitHashimportUtil.fetchJavadocIOForDependencyimportorg.jetbrains.dokka.gradle.AbstractDokkaLeafTaskimportorg.jetbrains.dokka.gradle.tasks.DokkaBaseTaskimportjava.time.Duration/* * Copyright (C) 2010-2024, Danilo Pianini and contributors * listed, for each module, in the respective subproject's build.gradle.kts file. * * This file is part of Alchemist, and is distributed under the terms of the * GNU General Public License, with a linking exception, * as described in the file LICENSE in the Alchemist distribution's top directory.*/
plugins {
id("org.jetbrains.dokka")
}
val minJavaVersion:String by properties
dokka {
dokkaSourceSets.configureEach {
enableKotlinStdLibDocumentationLink.set(true)
enableJdkDocumentationLink.set(true)
jdkVersion.set(minJavaVersion.toInt())
skipDeprecated.set(false)
skipEmptyPackages.set(true)
/* * Source links to GitHub*/listOf("kotlin", "java")
.flatMap { listOf("main/$it", "commonMain/$it", "jsMain/$it", "jvmMain/$it") }
.map { "src/$it" }
.associateWith { File(projectDir, it) }
.filterValues { it.exists() }
.forEach { (path, file) ->
sourceLink {
localDirectory.set(file)
val project =if (project == rootProject) ""else project.name
val url ="https://github.com/AlchemistSimulator/Alchemist/${ currentCommitHash?.let { "tree/$it" } ?:"blob/master" }/$project/$path"
remoteUrl.set(uri(url))
remoteLineSuffix.set("#L")
}
}
/* * Javadoc.io links for external dependencies*/val configured = mutableSetOf<ExternalDependency>()
configurations.configureEach {
val newDependencies = dependencies.withType<ExternalDependency>() - configured
configured += newDependencies
newDependencies.forEach { dependency ->val javadocIOURLs = fetchJavadocIOForDependency(dependency)
if (javadocIOURLs !=null) {
val (javadoc, packageList) = javadocIOURLs
externalDocumentationLinks.register(dependency.name) {
url.set(javadoc)
packageListUrl.set(packageList)
}
}
}
}
pluginsConfiguration.html {
customAssets.from(rootProject.file("site/static/images/logo.svg"))
customStyleSheets.from(rootProject.file("site/logo-styles.css"))
footerMessage.set("(c) Danilo Pianini and contributors listed in the Alchemist build files")
homepageLink ="https://alchemistsimulator.github.io/"
}
}
}
tasks.withType<DokkaBaseTask>().configureEach {
timeout.set(Duration.ofMinutes(5))
}
Installation
Operating system: Linux
Build tool: Gradle v8.11
Dokka version: 2.0.0
The text was updated successfully, but these errors were encountered:
* feat: enable Dokka v2
* build: enable the kotest runner on multiplatform projects
* build: enforce consistency in the KMP subprojects
* ci: fix new task name
* ci: make sure to fail on broken links
* docs: link the home page
* ci: fix broken retry mechanism
* docs: fix links to KDoc
* docs: limit docs generation to subprojects until Kotlin/dokka#3979 is fixed
* docs: include both multi-module and overall documentation
* docs: only check the multimodule website
* docs: fix typo
* docs: revise replacements
DanySK
pushed a commit
to AlchemistSimulator/Alchemist
that referenced
this issue
Dec 30, 2024
Describe the bug
I have a project with many subproject. The root project hosts the entrypoint of the entire application.
When generating documentation for the root project, if no subproject is added through
dependency
, only the local module's documentation is produced (as expected).When, instead,
is used, the documentation for all modules but the current is produced.
If
is used instead, the local module is included, but the left menu has broken links
Expected behaviour
Either the local module is always included, or it can be included in the dependencies without breaking the website
Screenshots
This is the documentation generated with
Links on the right work correctly, links in the left bar are broken.
To Reproduce
dokkaGenerate
Dokka configuration
The following is my convention plugin for dokka. Looks complicated , but all the complexity is just linking source from GitHub and linking libraries from javadoc.io.
Installation
The text was updated successfully, but these errors were encountered: