Skip to content

Commit

Permalink
Link to KDoc/Javadoc in their respective counterpart overview pages
Browse files Browse the repository at this point in the history
This commit adds a link in the package-overview pages of KDoc and
Javadoc, pointing to the other documentation's own page.

In order for local tests to work, the build has been slightly modified
to align with the directory structure in the distributed documentation
zip (and consequently with that of the deployed documentation website).

Lastly, the javadoc build was fixed to include the `overview.html` again
in the resulting HTML index, since this is where the KDoc link is added.

See gh-28055
Closes gh-31587
  • Loading branch information
simonbasle authored Nov 10, 2023
1 parent 8a7144b commit a97ecf7
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
6 changes: 4 additions & 2 deletions framework-api/framework-api.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ javadoc {
author = true
header = rootProject.description
use = true
overview = "framework-docs/src/docs/api/overview.html"
overview = "$rootProject.rootDir/framework-docs/src/docs/api/overview.html"
destinationDir = file("${project.buildDir}/docs/javadoc-api")
splitIndex = true
links(rootProject.ext.javadocLinks)
addBooleanOption('Xdoclint:syntax,reference', true) // only check syntax and reference with doclint
Expand All @@ -51,7 +52,8 @@ rootProject.tasks.dokkaHtmlMultiModule.configure {
tasks.named("javadoc")
}
moduleName.set("spring-framework")
outputDirectory.set(project.file("$buildDir/docs/kdoc"))
outputDirectory.set(project.file("$buildDir/docs/kdoc-api"))
includes.from("$rootProject.rootDir/framework-docs/src/docs/api/dokka-overview.md")
}

/**
Expand Down
2 changes: 2 additions & 0 deletions framework-docs/src/docs/api/dokka-overview.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# All Modules
_See also the <a href="../javadoc-api/" target="_blank">Java API documentation (Javadoc)</a>._
5 changes: 4 additions & 1 deletion framework-docs/src/docs/api/overview.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
<html>
<body>
<p>
This is the public API documentation for the <a href="https://github.com/spring-projects/spring-framework" target="_top">Spring Framework</a>.
This is the public Java API documentation (Javadoc) for the <a href="https://github.com/spring-projects/spring-framework" target="_top">Spring Framework</a>.
</p>
<p><em>
See also the <a href="../kdoc-api/" target="_blank">Kotlin API documentation (KDoc)</a>.
</em></p>
</body>
</html>

0 comments on commit a97ecf7

Please sign in to comment.