hfhbd
07/14/2021, 2:50 PMdokkaSourceSets.configureEach {
includes.from("README.md", "docImages/")
}
requires to create a folder docImages
in every module...Marcin Aman
07/14/2021, 2:58 PMhfhbd
07/14/2021, 3:00 PMReadMe.md
, which is presented in the module descriptionMarcin Aman
07/14/2021, 3:02 PMhfhbd
07/14/2021, 3:03 PMMarcin Aman
07/14/2021, 3:19 PMpluginConfiguration<org.jetbrains.dokka.base.DokkaBase, org.jetbrains.dokka.base.DokkaBaseConfiguration> {
customAssets = listOf(file("test.png"))
}
and you reference this image as:

You can find out more about pluginsConfiguration here:
https://kotlin.github.io/dokka/1.5.0/user_guide/gradle/usage/#applying-pluginshfhbd
07/14/2021, 3:41 PMMarcin Aman
07/14/2021, 3:42 PMhfhbd
07/14/2021, 4:00 PMbuildSrc
and it is not available using plain old build.gradle.kts
files, right? 😄Marcin Aman
07/14/2021, 4:03 PMbuildscript {
dependencies {
classpath("org.jetbrains.dokka:dokka-base:1.5.0")
}
}
If you dont want to include this dependency in buildscript you can always fallback to the json methodhfhbd
07/14/2021, 8:10 PMMarcin Aman
07/15/2021, 8:52 AMtasks.dokkaHtmlMultiModule {
includes.from("README.md")
pluginConfiguration<org.jetbrains.dokka.base.DokkaBase, org.jetbrains.dokka.base.DokkaBaseConfiguration> {
customAssets = listOf(file("a/docImages/"))
}
}
Later this is a case of adding a correct link to image. In case of this example: 
hfhbd
07/15/2021, 9:37 AMroot/build/dokka/htmlMultiModule/images/doc-images/
// not nice, but working without manually re-enter all projects again
tasks.dokkaHtmlMultiModule { // root tasks in build.gradle.kts
includes.from("README.md")
pluginConfiguration<org.jetbrains.dokka.base.DokkaBase, org.jetbrains.dokka.base.DokkaBaseConfiguration> {
customAssets = subprojects.map { "${it.path.drop(1).replace(":", "/")}/docImages/" }.mapNotNull {
File("${project.projectDir.path}/$it").takeIf { it.exists() }
}
}
}
But it looks like, I have to change the paths in the Readme files too, right? This would mean, it is not possible to see the images in the readme viewer in Intellij/GitHub.
In theory, it would be perfect, if Dokka will prefix all images paths with "/images".