https://kotlinlang.org logo
Join SlackCommunities
Powered by
# dokka
  • a

    ansman

    12/26/2024, 7:20 PM
    Has anyone migrated to dokka 2 and use multi module HTML paired with the versioning plugin? I'm just getting that the root ask is skipped because it's not enabled
    m
    h
    +3
    • 6
    • 14
  • r

    Robert Jaros

    12/28/2024, 3:38 PM
    I've set
    V2EnabledWithHelpers
    property, but what should I expect now? How these "helpers" work?
    a
    • 2
    • 1
  • r

    Robert Jaros

    12/28/2024, 6:13 PM
    I'm using gradle plugin v2. I have a project with sources and also some sub-projects. I'm using
    dependencies {}
    to aggregate documentation from the sub-projects but I also want to see the documentation for my root project. It doesn't seem to work by default. More in 🧵
    a
    • 2
    • 20
  • d

    David Herman

    01/02/2025, 11:11 PM
    I believe these javadoc docs (around generating a javadoc jar for multiplatform projects) need to be updated for Dokka 2.0.0? https://kotlinlang.org/docs/dokka-gradle.html#build-javadoc-jar
    a
    c
    • 3
    • 10
  • k

    kevin.cianfarini

    01/05/2025, 12:04 AM
    Does anyone have any examples of the versioning plugin being used with a single module Kotlin multiplatform project? These examples don't cover that. https://github.com/Kotlin/dokka/tree/2.0.0/examples/gradle
    o
    • 2
    • 10
  • c

    CLOVIS

    01/08/2025, 3:01 PM
    I'm writing a custom Dokka format, including a custom
    DokkaLocationProvider
    implementation. Currently, the documentation is generated using the human-readable module name:
    dokkaContext.configuration.moduleName
    which gives the output:
    api/-my%20-example%20-module/package.name/Class.md
    which isn't great for URLs. Instead, I'd prefer to use the module's Gradle project name, to get something like:
    api/my-example-module/package.name/Class.md
    Is this possible? I don't see anything that looks like that in
    org.jetbrains.dokka.DokkaConfiguration
    a
    • 2
    • 5
  • j

    Jacob Wingate

    01/09/2025, 1:22 PM
    I apologise in advance if this is a stupid query, but I am encountering an issue where
    dokkaHtml
    is populating elements that lack KDoc annotations, including a "Package-level declarations" section. My understanding was that only KDoc-annotated code should be included by default, but this does not seem to be the case in my project. I have attached an example showing the "Package-level declarations" being generated without corresponding KDoc annotations. Below is my current
    build.gradle
    configuration:
    Copy code
    tasks.dokkaHtml {
        dokkaSourceSets {
            named("main") {
                sourceRoots.from(file("src/main/kotlin"))
                displayName.set("Main Documentation")
                suppress.set(false)
                reportUndocumented.set(false) // Exclude undocumented elements
    
            }
            named("test") {
                sourceRoots.from(file("src/test/kotlin"))
                displayName.set("Test Documentation")
                suppress.set(false)
                reportUndocumented.set(false)
    
            }
        }
    }
    Any help would be greatly appreciated!
    g
    c
    • 3
    • 7
  • r

    Roberto Leinardi

    01/10/2025, 3:03 PM
    Hi everyone! 👋 I'm migrating to Dokka Gradle Plugin (DGP) version 2.0.0 in a multimodule project and need some help replicating the configuration I had with version 1.x. Previously, I could just apply the plugin to the modules I wanted documentation for and configure this in the root `build.gradle.kts`:
    Copy code
    dokkaHtmlMultiModule {
        outputDirectory.set(rootDir.resolve("docs/dokka"))
    }
    Everything worked seamlessly! 🚀 With version 2.x, it seems I now have to explicitly declare all the Dokka dependencies for the modules in the root `build.gradle.kts`:
    Copy code
    dependencies {
        dokka(project(":childProjectA"))
        dokka(project(":childProjectB"))
    }
    This manual step is tricky for me since my project has both dynamic modules (loaded via a JSON config) and static modules. In version 1.x, I could rely on Gradle's build conventions for automation, but now I feel like I have two sources of truth: 1. The standard Gradle configuration for modules. 2. The new Dokka dependencies I need to define manually. Is there an alternative approach for multimodule projects that would let me mark a project as a Dokka dependency directly in the module’s
    build.gradle.kts
    ? Something that works well with Gradle build conventions and can be automated? Thanks in advance for your insights!
    m
    c
    a
    • 4
    • 39
  • o

    Oleg Yukhnevich

    01/20/2025, 1:52 PM
    Hey folks! Thanks to everyone who updated to Dokka 2.0.0 and tried DGPv2! We really appreciate it and it will help as a lot with stabilization of it! But today I wanted to ask for a feedback about another big chunk of rework we were working recently and which is available in Dokka 2.0.0: K2 analysis! To remind a bit it's importance: future language features (like context parameters) will be supported only in K2 analysis! It'c crucial for us to understand how stable it is and how much work still need to be done. And while we constantly validating it on both internal (kotlinx.*) and some external projects, we can't cover all projects... It would be nice if you could try it in your projects and report any issues/inconsistencies! K2 analysis has some known limitations (mentioned in release notes) and known issues/inconsistencies - but most of them are not that scary 🙂 To opt in to Dokka's K2 analysis, add the following flag to your project's
    gradle.properties
    file:
    Copy code
    org.jetbrains.dokka.experimental.tryK2=true
    How to test that everything is fine? 1. just build documentation - should work in almost all cases 🙃 2. check several pages of generated API reference - there could be minor differences comparing to K1 analysis - still it would be nice to report them if they are not mentioned in known issues/inconsistencies or potential differences (mentioned in release notes) It's also possible to compare generated HTML's side-by-side, but unfortunately there could be a lot of noise there 😞 Anyway, we would really appreciate your feedback! kodee loving P.S. don't be afraid to ask any questions regarding K2 here in thread or in channel!
  • r

    Robert Jaros

    01/22/2025, 10:47 AM
    I have a project with both JS and WasmJS targets. When building documentation with Dokka 2.0.0 I see prefixes like this
    [wasmJs]
    and
    [js]
    on functions and classes defined in both targets. Screenshot in thread.
    o
    • 2
    • 7
  • r

    Robert Jaros

    01/22/2025, 7:06 PM
    Dokka 2 is really hungry for resources 😉 Had to set max heap size to 12G and close all other applications to generate documentation for my project with about 40 modules (It took 6 minutes with load average ~40 and made my 32GB thinkpad unresponsive).
    o
    • 2
    • 20
  • a

    Adrian Landborn

    01/24/2025, 10:14 AM
    Hi! Is there a way to disable the “Run” and “Open in Playground” options? This is Android 🤖 code so it won’t compile/render. Thanks.
    o
    • 2
    • 1
  • d

    Dries Samyn

    01/29/2025, 5:22 PM
    Hello. I've moved my project to Doka 2 and been trying to move to the Doka 2 api but I've ran into a few problems. I logged an issue here a few weeks ago, but have not received any response. Can anybody here shed a light? I'm happy to dig into the code and help fix stuff if it is a bug, but it'd be good to have an aknowledgement of whether there's a bug or it's me doing something wrong.
    a
    • 2
    • 2
  • 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