Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inconsistency in place of applying configuration options for multi-module projects #2419

Open
atyrin opened this issue Apr 5, 2022 · 2 comments
Labels
bug configuration An issue/PR related to Dokka's configuration by the user

Comments

@atyrin
Copy link
Contributor

atyrin commented Apr 5, 2022

For multimodule projects configuration, it's not clear where to apply configuration options. The place differs depending on the option.
Let's consider the configuration:

pluginConfiguration<org.jetbrains.dokka.base.DokkaBase, org.jetbrains.dokka.base.DokkaBaseConfiguration> {
        customStyleSheets = listOf(file("west-cost-customs.css"))
        footerMessage = "Root Footer"
        mergeImplicitExpectActualDeclarations = true
        templatesDir = file("templates")
    }

If it is applied on the root project level (in dokkaHtmlMultiModule) then the styles from customStyleSheets will be propagated to all submodules. Other options will be applied only on the root level.
If it is applied on the module level (in dokkaHtmlPartial) then the customStyleSheets will be ignored and other options will be applied on the module level.

It is confusing that all of them are located in the same place.

Installation

  • Build tool: Gradle
  • Dokka version: 1.6.20

Sample project: repro.zip
Template from the root with ROOT in title applied only for root page. prism.css applied for all pages.

The relevant issue for documenting the behavior: #2202

@atyrin atyrin added the bug label Apr 5, 2022
@vmishenev
Copy link
Member

Submodules know nothing about configuration of a root project. Partial tasks do not create resource files (stylesheets, scripts) since a root project generates all resources and they are shared between the submodules. So the dokkaHtmlPartial configuration is only responsible for right tags in html: <link href="styles/west-cost-custom.css.css" rel="Stylesheet">.

In your cases:

  1. If it is applied ONLY on the root project level then dokkaHtmlMultiModule will create west-cost-customs.css file but the stylesheet will be no applied in html of submodules. (there is not tag <link href="styles/west-cost-custom.css.css" rel="Stylesheet"> )
  2. If it is applied ONLY on the module level (in dokkaHtmlPartial) then there will be the needed tag but the file will be not created.

Unfortunately It is not trivial.
I hope we will change the configuration dokkaHtmlMultiModule in new Gradle plugin.

@IgnatBeresnev IgnatBeresnev added the configuration An issue/PR related to Dokka's configuration by the user label Mar 8, 2023
@IgnatBeresnev IgnatBeresnev added this to the Gradle runner 2.0 milestone Aug 17, 2023
@chris-hatton
Copy link

chris-hatton commented Nov 28, 2023

Arrived here after being confused why my configuration options weren't applying in a multi-module project.
Please, at least be up-front about this incompatibility/limitation with multi-module in the Dokka documentation/how-to section. You really don't want intrepid new users to bounce off feeling frustrated and defeated because it's not behaving as advertised.

Not for want of trying either; I'm hitting it with many combinations like this:

subprojects {
    apply(plugin = "org.jetbrains.dokka")
    tasks.withType<DokkaTaskPartial>().configureEach {
        pluginConfiguration<DokkaBase, DokkaBaseConfiguration> {
            customAssets = listOf(file("logo-icon.svg"))
            footerMessage = "Copyright 2023 Redacted Ltd"
        }
    }
}

...but nothing's changing the logo or footer for me. If this is so hard to solve, does this call the design of Dokka into question?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug configuration An issue/PR related to Dokka's configuration by the user
Projects
None yet
Development

No branches or pull requests

4 participants