I'm using KSP to generate documentation. KSP is a hook in the compilation, allowing you to write kotlin files during the build, but it's not limited to kotlin files, so that's totally doable.
Dokka is good if you want a technical API documentation.
I was in need of a more elaborated tool to be able to have some part manual documentation and some parts generated documentation, with eventually a more high-level documentation that only code api, so I wrote 2 little open-source tools if ever it can be useful to you :
•
K2D that uses KSP to generate mermaid graphs. Sorry it's not properly released today, but you can use the 0.4.1 version from this
repo. You can generate UML-like graphs with Mermaid, and embed them in some markdown files. You can also generate a table format for a class to display fields/types/comments from code.
•
GRIP that is a gradle plugin to be able to load some markdown files from build/generated and mix them with some other files easily (you describe a kind of template that have directives, so you can easily mix manual and generated).
I'm the main user right now, don't hesitate to ask for more.