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

[Dokka Configuration] How to change the relative url path for a specific module when generating documents for multi-module project #4043

Closed
rex-stripe opened this issue Feb 28, 2025 · 2 comments
Labels
question A user question, can be resolved if the question is answered/resolved runner: Gradle plugin An issue/PR related to Dokka's Gradle plugin

Comments

@rex-stripe
Copy link

Question
At times we want to customize the module name in the document, instead of using the default source code module name. The configuration option moduleName can change the display name, but not the relative url path that represents this module -- which is still the default source code module name.

Is there a way to achieve this configuration? If not, can this be considered a feature request? Thanks!

Screenshots
Edited dokka-multimodule-example is used. Display name of childProjectA is changed to test1 but childProjectA is still in the url.

Image Image
@rex-stripe rex-stripe added the question A user question, can be resolved if the question is answered/resolved label Feb 28, 2025
@rex-stripe rex-stripe changed the title [Dokka Configuration]How to change the relative url path for a specific module when generating documents for multi-module project [Dokka Configuration] How to change the relative url path for a specific module when generating documents for multi-module project Feb 28, 2025
@adam-enko
Copy link
Member

Hi, please could you try using modulePath to control the path.

/**
* Control the subdirectory used for files when aggregating this project as a Dokka Module into a Dokka Publication.
*
* When Dokka performs aggregation the files from each Module must be placed into separate
* subdirectories, within the Publication directory.
* The subdirectory used for this project's Module can be specified with this property.
*
* Overriding this value can be useful for fine-grained control.
* - Setting an explicit path can help ensure that external hyperlinks to the Publication are stable,
* regardless of how the current Gradle project is structured.
* - The path can also be made more specific, which is useful for
* [Composite Builds](https://docs.gradle.org/current/userguide/composite_builds.html),
* which can be more likely to cause path clashes.
* (The default value is distinct for a single Gradle build. With composite builds the project paths may not be distinct.)
* See the [Composite Build Example](https://kotl.in/dokka/examples/gradle-composite-build).
*
* **Important:** Care must be taken to make sure multiple Dokka Modules do not have the same paths.
* If paths overlap then Dokka could overwrite the Modules files during aggregation,
* resulting in a corrupted Publication.
*
* Default: the current project's [path][org.gradle.api.Project.getPath] as a file path.
*/
abstract val modulePath: Property<String>

The documentation will be updated in #4025

@adam-enko adam-enko added the runner: Gradle plugin An issue/PR related to Dokka's Gradle plugin label Mar 4, 2025
@rex-stripe
Copy link
Author

@adam-enko Thx!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question A user question, can be resolved if the question is answered/resolved runner: Gradle plugin An issue/PR related to Dokka's Gradle plugin
Projects
None yet
Development

No branches or pull requests

2 participants