https://kotlinlang.org logo
#dokka
Title
# dokka
s

Sergio

03/13/2024, 4:14 PM
Hi all! I’m working with a kotlin multiplatform project, is there a way to set the project name when generating dokka files? .html title is
shared
o

Oleg Yukhnevich

03/13/2024, 4:34 PM
Hey! what do you mean by
project name
? title on top of the website? AFAIR there is
moduleName
property available on tasks - https://kotlinlang.org/docs/dokka-gradle.html#general-configuration
s

Sergio

03/13/2024, 4:40 PM
moduleName
doesn’t change it 😞
o

Oleg Yukhnevich

03/13/2024, 4:49 PM
Could you show please full Dokka setup for your module?
s

Sergio

03/13/2024, 4:52 PM
Copy code
val dokkaOutputDir = "../docs/$version"
tasks.dokkaHtml {
  val currentVersion = version
  outputDirectory.set(file(dokkaOutputDir))
  dokkaSourceSets {
    configureEach {
      suppress.set(false)
      documentedVisibilities.set(setOf(Visibility.PUBLIC))
      skipEmptyPackages.set(true)
      includeNonPublic = false
      reportUndocumented = true
      skipEmptyPackages = true
    }
  }
  pluginConfiguration<VersioningPlugin, VersioningConfiguration> {
    version = currentVersion
    olderVersionsDir = file("../docs")
    renderVersionsNavigationOnAllPages = true
  }
}
my bad, you’re right
moduleName
works, it was a problem with how I was handling multi-module project
o

Oleg Yukhnevich

03/13/2024, 5:11 PM
yeah, in case of multi-module project you need to do:
Copy code
tasks.dokkaHtmlMultiModule {
    moduleName.set("Custom name")
}
in root project
🙌 1