[Dokka 2] Table header rendered as empty
Describe the bug
If I use a table in my documentation (both code documentation and included files), the header is displayed as empty.
Expected behaviour
The header of the table is displayed.
Screenshots
To Reproduce
The screenshots above were generated with the following documentation:
/**
* | Column A | Column B | Column C |
* |-----|-----|-----|
* | Cell 1 | Cell 2 | Cell 3 |
* | Cell 4 | Cell 5 | Cell 6 |
*/
Installation
- Operating system: macOS 15.1
- Build tool: Gradle v8.10.2
- Dokka version: 2.0.0-Beta
Dokka configuration
https://github.com/SRGSSR/pillarbox-android/blob/4a3ae5e3df1dc7ba041e1f91ad3164e3d022ff28/build.gradle.kts#L20-L37
https://github.com/SRGSSR/pillarbox-android/blob/4a3ae5e3df1dc7ba041e1f91ad3164e3d022ff28/build-logic/plugins/src/main/java/ch/srgssr/pillarbox/gradle/PillarboxAndroidLibraryPublishingPlugin.kt#L89-L114
Hi, could you provide the full code block you're using? I've tried it quickly and with the following code:
/**
* | Column A | Column B | Column C |
* |-----|-----|-----|
* | Cell 1 | Cell 2 | Cell 3 |
* | Cell 4 | Cell 5 | Cell 6 |
*/
val asd = ""
So, I wonder if there's something specific about how the KDoc is declared that is causing the issue. I see an enum in your screenshot, maybe that's related
That was the whole KDoc. I just tried on an interface, a field and a method:
With the same result:
I've added my Dokka configuration in my first message, in case it helps.
Hey! I also can't reproduce the original issue, and always see table header, no matter where I will put it. If it's reproduced in your project, could you please share the link to the class where it could be reproduced or as a separate GitHub project?
You can check out the following project: https://github.com/SRGSSR/pillarbox-android on the dokka_table_demo branch.
I've added a table in the PillarboxPlayer interface.
If you run ./gradlew :dokkaGenerate and open this page, you'll see that the table doesn't have any header.
The global Dokka configuration is available here: https://github.com/SRGSSR/pillarbox-android/blob/b69923e324f941c2380f799d6101e77cc5e07654/build.gradle.kts#L20-L45
And we have a Gradle plugin for per-module configuration: https://github.com/SRGSSR/pillarbox-android/blob/b69923e324f941c2380f799d6101e77cc5e07654/build-logic/plugins/src/main/java/ch/srgssr/pillarbox/gradle/PillarboxAndroidLibraryPublishingPlugin.kt#L89-L130
Let me know if you need help to set up the project, or to reproduce the issue.
I'm encountering this too (in my androidx-ktx-extras project), and this seems to happen when I tried to update my binary library publishing plugin to accommodate for JVM libraries.
Previously, I was suppressing all source-sets except for the main source-set, which seems to work (as can be seen here):
dokkaSourceSets {
configureEach {
suppress.set(true)
}
named("main") {
suppress.set(false)
}
}
(From LibraryPlugin.kt; Module.md is then added from lines 359 to 365)
(The Markdown file for the doc above)
After removing that block above, this results in the table headers being absent:
I've noticed that @MGaetan89's project is an Android project, so perhaps this issue might be specific to Android projects?
I then did some digging into the resulting dokka-configuration.json, and found that the config has a "debug" and "release" source-set as well, resulting in 3 separate source-sets:
build/tmp/dokkaGeneratePublicationHtml/dokka-configuration.json:
{
// ...
"sourceSets": [
{
"displayName": "androidJvm",
"sourceSetID": {
"scopeId": ":androidx:recyclerview:recyclerview-ktx",
"sourceSetName": "debug"
},
// ...
"includes": [
"<truncated>/recyclerview-ktx/Module.md"
]
},
{
"displayName": "androidJvm",
"sourceSetID": {
"scopeId": ":androidx:recyclerview:recyclerview-ktx",
"sourceSetName": "main"
},
// ...
"includes": [
"<truncated>/recyclerview-ktx/Module.md"
]
},
{
"displayName": "androidJvm",
"sourceSetID": {
"scopeId": ":androidx:recyclerview:recyclerview-ktx",
"sourceSetName": "release"
},
// ...
"includes": [
"<truncated>/recyclerview-ktx/Module.md"
]
}
]
}
Does Dokka perhaps expect only a single Android source-set for it to work?