Hello hello, I would like to do some documentatio...
# ksp
Hello hello, I would like to do some documentation on my project. Automated solution would be even more convenient to have an up-to-date doc. So I started using annotations and KSP. If I'm not mistaken, KSP is primarily used to parse the codebase and generate new code. In my case, I mainly want to generate a report related to these annotations, no classes and other things. If there are any KSP enthusiasts here, am I on the right track? Because currently, I'm unable to get a precise log output of the result. But according to the articles I find, it's mostly files (
). Which is not what I'm interested in for this specific case. Thank you for your ideas.
you might find Dokka a more suitable tool for generating documentation. You can write a custom plugin if you have a custom format.
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.