Wesley Hartford
01/11/2024, 6:31 PMdokkaHtmlMultiModule task, but the platform project does not show up in the resulting documentation. What I'd like to see is simply the project's Module.md file rendered into the docs as it is for other projects.Wesley Hartford
01/11/2024, 6:32 PMOleg Yukhnevich
01/12/2024, 9:34 AMkotlin + java-platform plugins can be not compatible
And if there is no kotlin plugin, there will be no sourceSets in dokka plugin (and so no documentation is generated)
So you can try to add custom dokka sourceSet to tasks, and include Module.md there
Something like this:
plugins {
id(java-platform")
id("org.jetbrains.dokka")
}
tasks.withType<AbstractDokkaTask>().configureEach {
dokkaSourceSets.register("main") {
// configuration goes here
include.from("Module.md")
}
}
May be there will be needed some additional configuration inside (as there could be no defaults for some values), but overall, this should work I beleive
I think, that's because this project don'Wesley Hartford
01/12/2024, 3:45 PMAbstractDokkaTask doesn't have a dokkaSourceSets, but AbstractDokkaLeafTask does. That's a big help in other areas since I've been configuring DokkaTask and DokkaTaskPartial separatly.
Unfortunately, adding that configuration did not end up generating any content. My platform project still does not show up under All modules, and the platform/build/dokka/htmlPartial directory gets created but is empty. Do you have any further configuration suggestions?Oleg Yukhnevich
01/12/2024, 6:24 PMWesley Hartford
01/12/2024, 6:33 PM> Task :platform:dokkaHtmlPartial
Initializing plugins
Dokka is performing: documentation for platform
Validity check
Creating documentation models
Transforming documentation model before merging
Merging documentation models
Exiting Generation: Nothing to documentOleg Yukhnevich
01/12/2024, 6:39 PMyeah, looks like if there is no files, there will be empty output So, next thing you can try is to create an empty file, likeCopy codeExiting Generation: Nothing to document
stub.kt and add it location to sourceSet:
f.e. put stub.kt into kotlin-stub-src dir there (or could be generated and placed in build to not pollute the project) and configure path
dokkaSourceSets.register("main") {
sourceRoots.from("kotlin-stub-src") // or `from("build/kotlin-stub-src")
include.from("Module.md")
}
may be this will work 🙂Wesley Hartford
01/12/2024, 7:08 PMOleg Yukhnevich
01/12/2024, 7:28 PMAPI documentation engine , not just documentation engine so this is not directly Dokka responsibility IMO. But I understand that sometimes it could be useful to just embed everything there.
BTW, Have you tried something like mkdocs? https://squidfunk.github.io/mkdocs-material/
With rather easy setup it's possible to generate documentation not only for API reference + having same Module.md file rendered both in API reference and on website.
Example (opinionated, as it's mine):
• root: https://whyoleg.github.io/cryptography-kotlin/
• api reference: https://whyoleg.github.io/cryptography-kotlin/api/ (via Dokka)
• BOM module documentation: https://whyoleg.github.io/cryptography-kotlin/bom/
• documentation for openssl module (same file is used for both pages):
◦ on website: https://whyoleg.github.io/cryptography-kotlin/modules/cryptography-provider-openssl3/
◦ in api reference: https://whyoleg.github.io/cryptography-kotlin/api/cryptography-provider-openssl3-api/index.htmlWesley Hartford
01/12/2024, 7:35 PM