https://kotlinlang.org logo
Join Slack
Powered by
# dokka
  • y

    Yannick Pulver

    02/03/2025, 7:43 PM
    Hi! I wanted to try out Dokka2 and followed the migration guide. When running
    dokkaGenerate
    I’m currently receiving this error using Kotlin 2.1.0, Serialization 1.8.0, Dokka 2.0.0.
    Copy code
    Execution failed for task ':shared:dokkaGeneratePublicationHtml'.
    > Could not initialize class kotlinx.serialization.json.JsonLiteralSerializer
    
    Exception java.lang.NoClassDefFoundError: kotlin/uuid/Uuid [in thread "Execution worker Thread 3"]
    We’re using Kotlin Uuid in some parameters. Do you happen to have met this issue before?
    c
    • 2
    • 2
  • v

    vignesh

    02/06/2025, 6:15 AM
    Hi, I am documenting my company's code using Dokka I am facing a few issues can someone please guide me a bit. My output format is html 1. Private members are not visible in the final output 2. All the class names are fully qualified making it harder to navigate and verbose. 3. The navigation has a flat structure and doesn't represent the actual folder hierarchy. I have added this in repo issues too: https://github.com/Kotlin/dokka/issues/3994#issue-2787268324
    m
    a
    o
    • 4
    • 21
  • u

    Utkarsh Tiwari

    02/07/2025, 12:49 AM
    Hi, my project has pre-existing markdowns files that were manually written. Is it possible to make Dokka populate pages for these markdowns besides generating docs from KDocs?
    o
    • 2
    • 1
  • b

    Benjamun Sautner

    02/07/2025, 7:28 PM
    I'm spending this afternoon adding dokka for the first time and hopefully get the output picked up and deployed with my Writerside docs I deploy to github pages. I just noticed when I first added the plugin I had a deprecation warning to update to v2 which I did the
    dokkaGfm
    task disappeared - I know it's in alpha, was it removed in v2? The docs suggest it's only in v2
    o
    • 2
    • 2
  • p

    Piotr Krzemiński

    02/12/2025, 10:02 AM
    I'm wondering if there are plans to implement @value Javadoc tag not handled by Dokka/KDoc. As a library owner, it would let me write easier-to-read KDoc, without making the user click too much CC @Vampire
    o
    • 2
    • 1
  • a

    Adrian Landborn

    02/17/2025, 2:50 PM
    Is there away to not recompile `olderVersionsDir`every time we run
    DokkaMultiModuleTask
    . The reason being that we do release once per month (sometimes even more frequent) and the folders are piling up and and it takes longer and longer time to recompile/generate HTML for all old version. Maybe we are doing some things wrong? 🤔
    👀 1
    e
    o
    s
    • 4
    • 28
  • a

    Abhimanyu

    03/04/2025, 2:55 AM
    Hi all 👋 , I have added Dokka to my project recently. I have added version
    2.0.0
    , but I see the following message. Is there anyway to show the message only for projects using the old version instead?
    solved 1
    r
    s
    • 3
    • 9
  • u

    Utkarsh Tiwari

    03/06/2025, 4:28 PM
    Hi team, how can I force dark theme in Dokka? Currently, my dokka site changes theme based on MacOS theme (dark and light) setting. However, I would like to force it to dark theme only so that I can match it with MkDoc's dark theme because I have setup a docsite using the combination of MkDocs and Dokka.
    s
    • 2
    • 2
  • s

    solonovamax

    03/06/2025, 10:45 PM
    hey, I just noticed that the dokka plugin template repository has not been updated since dokka 1.9.10 I think it'd probably be a good idea to update it to dokka 2.0.0
    o
    s
    • 3
    • 2
  • l

    Lee Griffiths

    03/18/2025, 4:08 PM
    I have a bunch of kotlin files, and I use KDoc comments inside of them. I want to provide some documentation describing a package as a whole. How do I do that? There's a page here that suggests it's possible: https://kotlinlang.org/docs/dokka-module-and-package-docs.html But it provides 0 details on how to do this, it just says "Documentation for a module as a whole, as well as packages in that module, can be provided as separate Markdown files." without telling me what the path of these files should be. When googling for the kotlin equivalent of
    package-info.java
    you find a lot of links to dead pages/anchors at http://kotlinlang.org/docs/reference/kotlin-doc.html#module-and-package-documentation but I'm not sure if that's the same contents as the above, or not.
    o
    c
    • 3
    • 4
  • p

    peterthee

    04/01/2025, 11:49 AM
    Hi, I am currently migrating to Dokka 2, but I am unable to define multiple Dokka tasks in order to generate dedicated reports for test or main source code. In Dokka 1, we had the following two gradle tasks that could be executed independently and generated either :
    task generateTestDocs(type: DokkaTask) {
    dokkaSourceSets {
    ...
    }
    }
    task generateAppDocs(type: DokkaTask) {
    dokkaSourceSets {
    ...
    }
    }
    Now in Dokka 2, whenever I register a DokkaTask like so I get an exception:
    tasks.register<DokkaTask>("generateTestDocs") {
    outputDirectory.set(layout.buildDirectory.dir("testDocs"))
    ...
    }
    FAILURE: Build failed with an exception.
    * What went wrong:
    Execution failed for task ':generateTestDocs'.
    > java.lang.ClassNotFoundException: org.jetbrains.dokka.DokkaBootstrapImpl
    I have read through the migration guide, but couldnt really determine whether that should still be an option. Generating a single output file does work, but we are required by process to have them independently. Could you give me any suggestion howto generate independent reports for different source sets within one project?
    a
    • 2
    • 6
  • a

    Adrian Landborn

    04/09/2025, 9:17 AM
    Does Dokka Gradle Plugin v2 support Markdown output? I can not wrap my head around it. Thanks
    r
    g
    +4
    • 7
    • 16
  • w

    Waldemar Kornewald

    04/14/2025, 7:35 AM
    Hi, does Dokka v2 support documenting the root module in a multi-module project, so the module overview page can be made more useful?
    h
    o
    • 3
    • 5
  • c

    CLOVIS

    04/21/2025, 1:06 PM
    Hey! Could someone please take a look at https://github.com/Kotlin/dokka/issues/4074?
    o
    • 2
    • 1
  • r

    Rok Oblak

    04/25/2025, 7:22 PM
    Hi, it may be a newbie question, but I did not see it mentioned - the generated HTML pages are huge because every single element is standalone and duplicated. So a single enum entry html page takes 160 lines of code. Meaning if I want to embed a quite small API reference as a static page in my website, it will take many tens of thousands of lines. Is this expected and is there no way around it?
    v
    • 2
    • 1
  • c

    CLOVIS

    05/03/2025, 5:39 PM
    I don't understand how the all-modules-page plugin works. Looking at the source of the
    org.jetbrains.dokka.gradle.formats.DokkaHtmlPlugin
    , there is a check but no configuration at all. The Javadoc plugin doesn't aggregate modules, and the other formats haven't been migrated to the Gradle plugin?
    a
    • 2
    • 29
  • k

    kevin.cianfarini

    05/05/2025, 6:03 PM
    Is there an easy way to parameterize Dokka module documentation? I have a section of my docs that looks something like this in the getting started section:
    Copy code
    [versions]
    cardiologist = "0.3.1"
    
    [libraries]
    cardiologist = { module = "io.github.kevincianfarini.cardiologist:cardiologist", version.ref = "cardiologist" }
    I want to parameterize the version number
    0.3.1
    so that I can inject it from my
    gradle.properties
    file. Is that possible?
    e
    a
    • 3
    • 4
  • t

    Tomas Kormanak

    05/13/2025, 11:30 AM
    Hi, I've upgraded version of Jackson in our project and dokka plugin stopped working. It says
    Copy code
    * What went wrong:
    Execution failed for task ':app:dokkaGeneratePublicationHtml'.
    > A failure occurred while executing org.jetbrains.dokka.gradle.workers.DokkaGeneratorWorker
       > 'void com.fasterxml.jackson.databind.type.TypeFactory.<init>(com.fasterxml.jackson.databind.util.LRUMap)'
    I tried this workaround to force dokka to use older Jackson, but it seems it does not work. https://github.com/Kotlin/dokka/issues/3472#issuecomment-2244628081 Any idea how to solve it?
    o
    • 2
    • 1
  • j

    Junbin Park

    05/16/2025, 3:57 AM
    Hi is there a way to load the child projects' custom assets to the root in dokka multi module? Seems like when there's a multi module configuration applied, the assets from the child projects defined with
    dokka(projects.x.y.z)
    is not loaded along with it.
    o
    • 2
    • 4
  • s

    Sebastien Leclerc Lavallee

    05/20/2025, 10:20 PM
    Hello! I'm configuring dokka currently and wanted to include the changelog file in my generated HTML I have this at the root
    build.gradle.kts
    :
    Copy code
    subprojects {
      apply("com.dokka...")
    
      afterEvaluate {
        dokka {
         dokkaPublications.html {
          moduleName.set("SOME - " + project.name)
          includes.from(project.layout.projectDirectory.file("CHANGELOG.md"))
         }
        }
      }
    }
    The file is at the correct location for each subproject, but I don't see my changelog file when I execute
    ./gradlew dokkaGenerate
    Is there anything missing ? Is that something that's possible? Thanks! 🙂
    j
    a
    • 3
    • 27
  • s

    Sebastien Leclerc Lavallee

    05/20/2025, 10:40 PM
    Also on another note... I generate that documentation for a library. I would like to exclude all code that is
    internal
    in each of my modules since it's not visible for anyone using the library? Thanks again!
    a
    • 2
    • 2
  • s

    Steven Zeck

    05/28/2025, 3:45 AM
    Hi all. I'm reading over changes for 2.0.0 and have a question about multi-module projects. How do you share Dokka configuration across modules and aggregate documentation from all of the modules? I've tried doing it this way in dokka-convention.gradle.kts, but it doesn't aggregate.
    Copy code
    plugins {
        id("org.jetbrains.dokka")
    }
    
    dokka {
        dokkaSourceSets.configureEach {
            reportUndocumented = false
            skipEmptyPackages = false
            skipDeprecated = true
        }
    
        dokkaPublications.html {
            outputDirectory.set(layout.buildDirectory.dir("docs"))
        }
    }
    
    dependencies {
        dokka(project(":project1"))
        dokka(project(":project2"))
    }
    And in each modules build.gradle.kts
    Copy code
    plugins {
      id("dokka-convention")
    }
    h
    • 2
    • 4
  • s

    Steven Zeck

    05/31/2025, 2:23 AM
    Ok got that working. Can you inject your own content in there, such as a getting started markdown file without having to do
    # Package
    or
    # Module
    ?
    h
    v
    • 3
    • 2
  • e

    Edoardo Luppi

    06/05/2025, 4:28 PM
    I'm migrating to Dokka v2, and after reading the migration steps there is still one point that's unclear. I currently have
    Copy code
    dokkaHtmlPartial {
      dependsOn(generateKotlinGrammarSource) // ANTLR task
    }
    in my sub-module build script. What's the correct task to use in place of
    dokkaHtmlPartial
    for this specific case?
    a
    • 2
    • 16
  • e

    Edoardo Luppi

    06/05/2025, 5:16 PM
    Is it expected in v2 to see
    Copy code
    > Task :module-name:logLinkDokkaGeneratePublicationHtml
    Generated Dokka HTML publication: localhost URL
    for every sub-module, even when I'm running
    dokkaGenerate
    at the top level with aggregation?
    a
    • 2
    • 7
  • e

    Edoardo Luppi

    06/05/2025, 5:29 PM
    Sharing my immediate feedback after the migration. 1. Setting a custom logo also required overwriting some CSS properties, otherwise the logo was stretched horizontally.
    Copy code
    .library-name--link::before {
      background-size: var(--dokka-logo-height) var(--dokka-logo-width);
      max-height: unset;
      max-width: unset;
    }
    2. The sidebar paddings are bit too much imo. 3. The hover highlight appears only on the package name or the toggle arrow, but not on both at the same time (is it intended?)
    o
    • 2
    • 1
  • n

    Nathan Fallet

    06/07/2025, 1:28 PM
    Hello! I wanted to know if there is a simple way to add custom markdown files. Like there is the kdoc, and I want to add an example/tutorial section in the menu, imported from markdown files (would seem to be the easiest option) There has to be an option or plugin for this (otherwise I’m making a plugin for it)
    h
    o
    • 3
    • 6
  • s

    Skolson5903

    06/14/2025, 1:46 AM
    Hopefully a quick question. I'm converting a kotlin multi-platform (KMP) library project to Dokka 2. I'm having trouble getting the HTML generated, and the doc at Dokka V 2.0 migration guide looks incorrect. It claims that this should be valid in the dokka block in build.gradle.kts:
    dokkaPublications.html {
    outputDirectory.set(rootDir.resolve("docs/api/0.x"))
    includes.from(project.layout.projectDirectory.file("README.md"))
    }
    but when I try this the html clause is an unresolved reference (using Idea 2025.2 EAP). And using the snippet below the builds/dokka folder has only an empty javadoc subfolder, so nothing is being generated. Since this is KMP I know V 2.0.0 doesn't support the javadoc option. What do I need to add to get the HTML to generate? Here's my beginning dokka snippet:
    Copy code
    dokka {
        moduleName.set("Kotlin Multiplatform Common IO Library")
        dokkaSourceSets.commonMain {
            includes.from("$appleFrameworkName.md")
        }
    }
    Also, as a followup, I've struggled to find an example of how to tell maven publish to publish the HTML once generated. I'd also appreciate any info on that. Thanks in advance for any help...
    o
    • 2
    • 12
  • n

    Nathan Fallet

    06/15/2025, 11:47 AM
    Hello! I saw this stale PR about sitemaps in Dokka. Is there any plan about it? I would love to see the feature, and can help if needed https://github.com/Kotlin/dokka/pull/2009
    o
    • 2
    • 4
  • s

    Skolson5903

    06/23/2025, 9:59 PM
    While diagnosing a publishing issue on my KMP project, I ran a gradle publish task with --info. The project is using
    applyDefaultHierarchyTemplate()
    so all the sourceSet names fit that template. Dokka produced a number of messages that surprised me, as if it doesn't understand the default hierarchy template. I posted the messages as a reply in this thread. Basically all the source sets that aren't leaf nodes in the default template are getting labeled as common. That seems to lead to it generating doc from appleMain into all the platforms, not just the Apple ones, etc. Is this expected behavior?
    o
    a
    • 3
    • 6