12

Is there a way to add a piece of top level KDoc for a Kotlin file?

Since Kotlin supports multiple variables, functions, classes, etc. in a single file, it makes sense to document the file as a whole. However, Documenting Kotlin Code - Kotlin Programming Language seems not to have any instructions on this.

Shreck Ye
  • 1,591
  • 2
  • 16
  • 32
  • 2
    I haven't seen anything regarding documenting a singular file, as files are more related to grouping together related functionality when the actual unit is the package/module. From the same documentation page: _"Documentation for a module as a whole, as well as packages in that module, is provided as a separate Markdown file, and the paths to that file is passed to Dokka using the `-include` command line parameter or the corresponding parameters in Ant, Maven and Gradle plugins."_ – mkobit Jun 08 '21 at 14:24

1 Answers1

1

There's no such feature; however, packages and modules can be documented like in Java

In Dokka, additional documentation files are added with include property (e.g. Gradle configuration).

Commander Tvis
  • 2,244
  • 2
  • 15
  • 41