CLOVIS
11/30/2025, 5:49 PM<head> of the HTML format.
I see I can do:
dokka {
pluginsConfiguration.html {
templatesDir.set(file("docs/dokka/overrides"))
}
}
However that seems to only apply to the "All modules" page. Is it possible to make it apply to all pages?Oleg Yukhnevich
12/01/2025, 9:31 AMCLOVIS
12/01/2025, 9:37 AMOleg Yukhnevich
12/01/2025, 9:57 AMrootProjectDir.resolve("dokka-templates") - and so put templates there on the final project side (plus optionally, have a fallback to option 1 if needed)
b. You can create an additional convention plugin on the final project side, configure templates there, and apply it instead of your convention plugin from the other repo. It's also possible to have a fallback, or even some additional Gradle extension, which will allow you to configure your convention plugin from the other repo.
I understand that none of those solutions are ideal, but the use case is far from typical.
The current Dokka architecture forces us to apply these configurations to both sub-projects and the aggregation project, and the Gradle architecture doesn't easily allow us to share configurations from the root project to sub-projects (keeping in mind that we also need to share data from sub-projects to the root project, too, e.g., outputs)
There are solutions for this, yes, but as far as I recall, we discussed this internally during the DGPv2 design and decided that sharing such configurations should be done via convention plugins within a project, rather than through some magic inside Dokka.
CC @Adam Semenenko, maybe he also has some ideas here that don't involve Dokka's re-architecture 🙂
Here is one of the issues related to this "configuration split."
In the future, KT-80323 Implement KDoc machine-readable representation, which should help with these kinds of problemsAdam Semenenko
12/01/2025, 10:03 AMmaybe he also has some ideas here that don't involve Dokka's re-architectureIf I could re-implement DGP I would stop generating the modules in the individual subprojects. Instead DGP would ship the raw materials (locations of source files, classpaths, etc) to the aggregating project and then the configuration can be applied once and consistently. DGP would lose the 'locality' of module-specific configuration, but it would be easier to solve problems like this. We can probably do this as part of KDoc machine-readable representation. Each subproject would expose the analysed data, and the aggregated project could focus on the front-end configuration.
CLOVIS
12/01/2025, 10:08 AM1. If you want all your other projects to have the same configuration and templates, then yes, the best way to go is to bundle those templates. In this case, I don't really see why in that case, you might want to update the templates separately per project (feel free to add more context here)I do want all of them to have the same configuration (at least, to my current knowledge). However, that configuration might change over time, and I have a three-tier configuration (convention plugin in a repo → the baseline repo → each project repo) so having it in the configuration plugin makes changes very slow. For this specific example, maybe I can live with it.
CLOVIS
12/01/2025, 10:11 AMDGP would lose the 'locality' of module-specific configuration, but it would be easier to solve problems like this.Intuitively, I would expect that module-specific configuration affects the contents (e.g. hide private members) and aggregation-wide configuration affects the rendering (e.g. the logo, the page title, etc)
Oleg Yukhnevich
12/01/2025, 10:20 AM