Does Dokka Gradle Plugin v2 support Markdown outpu...
# dokka
a
Does Dokka Gradle Plugin v2 support Markdown output? I can not wrap my head around it. Thanks
r
Support what?
a
Markdown output with the gfm-plugin
I am currently running html but we’ll want to generate Markdown outout as well.
Copy code
// Project level Dokka setup
pluginManager.withPlugin("org.jetbrains.dokka") {
    dokka {
        pluginsConfiguration.versioning {
            olderVersionsDir.set(layout.projectDirectory.dir("documentation/oldVersions"))
        }
        dokkaPublications.html {
            outputDirectory.set(layout.projectDirectory.dir("documentation/html"))
            includes.from("documentation/packages.md")
        }
    }
}
g
I didn't update this plugin from a while, I don't think it's compatible with Dokka 2, and I don't know if Dokka 2 natively support mermaid, but if ever this link can help you.
👍 1
h
It does! I use the plugin of @glureau everyday.
🥰 1
a
I only saw HTML support and no Markdown which I I am after.
h
Ohh, sorry yeah you are right, I use html as output and markdown + mermaid as input, not markdown as output.
g
Oh you want to generate a mermaid graph from kotlin classes? Then I've another (outdated?) experimentation for you, K2D, based on KSP it can generate mermaid graphs from classes relationships (inheritance / composition). I'm using it on Kotlin 2.0 actually, version 0.4.4, sorry for the lack of documentation, let me know if I can help setup.
🆒 1
c
I'm curious, what do you want to do with the markdown output? If by any chance you're trying to integrate into MkDocs (as I was), see https://opensavvy.gitlab.io/automation/dokka-material-mkdocs/docs/
o
Hey! Yeah, starting from DGPv2 we are phasing out markdown output format support (it was always in an Alpha status), as we currently have not enough resources to maintain it and it's popularity and quality is rather low and would like to concentrate more on the HTML format While on current moment the artifacts are there and it's possible to enable it via custom Gradle plugin (similar to how javadoc is supported) it's not decided if those will be available in future It would be really nice to understand what is the use-case for having Dokka markdown output in current state?
😢 1
p
I used the markdown output so that it could integrate with the rest of the project documentation that was done with
mkdocs
. I'd like to avoid the reference API pages having a completely different theme from the rest of the documentation (
mkdocs-material
).
I actually bumped into this same issue recently. The project has had a stable API for a while, so I didn't make any changes to the repo. But now I have an idea to improve it and tried updating all of the dependencies as a first step. Dokka 2.0 was the only stumble because of the previous use of markdown output.
a
Thanks for the input guys! Too bad the MD solution is descoped. The reason for using it was to be able to use it to feed the internal chat bot. According to the team working with the chatbot it would be way easier to use the md-files as learning data rather than scraping the html output.
c
If that's what you want, my MkDocs plugin would work for you I think. Its output is regular Markdown, the only difference with the official Markdown plugin is the folder structure and a few MkDocs-specific annotations (e.g. language fences) but that shouldn't bother a chat bot.
👍 1
a
Will this also work with multi-module setup @CLOVIS?
c
Multi-module works but links from one module to another are not generated (should be fixed soon I hope). However, if you're feeding that to a chatbot, it can't follow links anyway, so that doesn't make a difference. If you want to see it in action on a real project,
Copy code
git clone <https://gitlab.com/opensavvy/ktmongo.git>
cd ktmongo/docs/website
./gradlew docs:website:embedDokkaIntoMkDocs
then look in
docs/website/docs/api
🙌 1