Kotlin / dokka

API documentation engine for Kotlin
https://kotl.in/dokka
Apache License 2.0
3.43k stars 407 forks source link

Reporting values of const vals (Strings) #2008

Open G00fY2 opened 3 years ago

G00fY2 commented 3 years ago

In Javadoc there is the @value tag to reference values of a static field. Currently there seems to be no equivalent way with KDoc / dokka.

I am not sure why #488 got closed by #1489, because this PR only added a presentation for primitive types.

Please add a way to reference and present non primitive values (Strings) of static fields in the documentation.

atyrin commented 2 years ago

It became visually inconsistent with the new change from 1.6.20: supported default values in the main declaration

image
naddeoa commented 2 years ago

It would be great if the implementation here would also work for enums.

enum class Options(val defaultValue: String? = null) {
    OPTION_1("foo"),
    OPTION_2 // no default
}

Documenting enum properties per case without having to manually specify them again in the kdoc would be very convenient.