Questions tagged [kdoc]

KDoc is a documentation generation system which reads specially formatted comments in Kotlin source code and generates compiled documentation. It is typically used to produce API documentation in the form of HTML web pages.

Resources

Documenting Kotlin code

70 questions
2
votes
1 answer

Documenting properties in KDoc

I see much code, which uses the tag @property to document properties: /** * Some Class * * @property p Some property */ class C { val p = 42 } But I prefer to document properties where the are defined: /** Some Class */ class C { /** Some…
ceving
  • 21,900
  • 13
  • 104
  • 178
2
votes
1 answer

Kotlin Documentation: Link to methods with different signatures?

In Java, we have something like this: /** * Link1: {@linkplain java.io.Writer#write(int)} * Link2: {@linkplain java.io.Writer#write(char[],int,int)} */ Clicking on the links take to different methods. I could somewhat achieve the first link with…
SayantanRC
  • 799
  • 7
  • 23
2
votes
2 answers

Reference resources in kotlin kdoc are not clickable

I want to mention a layout in my Javadoc which converted from java to Kotlin. In java it was: /** * ... inside the {@link R.layout#view_main} */ which was clickable, but when I converted this class using android studio tools. It is changed…
AliSh
  • 10,085
  • 5
  • 44
  • 76
2
votes
1 answer

How to add a KDoc comment for the receiver of a Kotlin extension function (first parameter in Java, `this` in Kotlin)

Consider this non-extension function: fun checkArguments(expression: Boolean) { if (!expression) { throw IllegalArgumentException() } } When I use this function in kotlin and java, I can see its parameter name: expression. I could…
FredSuvn
  • 1,869
  • 2
  • 12
  • 19
2
votes
2 answers

KDoc / Dokka: Ignore inherited methods in subclass

I am generating documentation using KDoc/Dokka for an android library. I have a custom view, which extends LinearLayout. The problem is that LinearLayout contains hundreds of public methods. Dokka generates empty documentation for all of these…
Hannes Hertach
  • 499
  • 5
  • 23
2
votes
1 answer

KDoc: change parameters order

I have the following parameters in a companion object on Kotlin companion object Constants { /** * Values for the various type of connection that a device can have. */ const val CONNECTION_KEY = "Connection_type" const val…
Lore
  • 1,286
  • 1
  • 22
  • 57
2
votes
1 answer

Gradle sync file fails every time, implementing Dokka

Tried to implement Dokka in code but keep running into Gradle sync failed: Could not find method classpath() for arguments [org.jetbrains.dokka:dokka-gradle-plugin:0.9.16-eap-2] on object of type…
KKNg
  • 87
  • 1
  • 5
2
votes
0 answers

How to document default argument with KDoc

Is there a syntax to documenting default arguments with KDoc, or should I do it manually? /** * A group of *members*. * * This class has no useful logic; it's just a documentation example. * * @property name the name of this group. Default…
Feedforward
  • 4,521
  • 4
  • 22
  • 34
2
votes
1 answer

Android Dokka - Only generate docs for my code and skip everything else

I'm using Dokka v0.9.17 for Android. When I run ./gradlew dokka it generates the docs but it include so many packages that I don't care about like android.support.fragment and packages for all the third party libraries. How can I tell Dokka to only…
Alireza Ahmadi
  • 5,122
  • 7
  • 40
  • 67
2
votes
0 answers

Reference Spek Test in Kotlin documentation

I'm working with the kotlin Spek testing framework and want to link to a Spec in my documentation. But when referencing the Spec IntelliJ shows me that it doesn't find the Spec. That's understandable because the Spec is in a test root. But is there…
nikolausk
  • 31
  • 2
2
votes
1 answer

How to link to a static member of a Java class in KDoc?

In KDoc, you can do this: /** * [Integer.equals] is an instance method. */ But you can't do this: /** * [Integer.signum] is a static method. */ By "you can't" I mean that IntelliJ IDEA won't lead you to the declaration of a static member if…
gvlasov
  • 18,638
  • 21
  • 74
  • 110
1
vote
1 answer

Android library missing documentation on Android studio Kdoc Dokka

When I import my library from maven there's no available documentation on Android Studio/IntelliSense. Even if I set up Dokka properly and javadoc.jar is present on the maven repo, still can't get it to work. This is the gradle script: task…
1
vote
1 answer

What is the proper way to annotate variable with KDoc?

I'm tried to annotate like @property but it is not right. Dokka does not recognise it For example enum: enum class Vegetables(val id: Int) { POTATO(1), CARROT(2), CUCUMBER(3) }
1
vote
0 answers

How to only show the functions that are defined in the class for Dokka Kotlin Kdoc?

Question How to only show the functions that are defined in the class? Screenshots Installation Operating system: Windows Build tool: Gradle v6.8.2 Dokka version: 1.4.20 Additional context Please specify in my Android build.gradle file, what…
shire
  • 61
  • 5
1
vote
1 answer

How to run Dokka offline in Android

I want to run Dokka offline to generate the documentation as the build running system doesn't need internet access so the document need to be generated offline. Is it possible? If yes, plz suggest the same. Thanks Binay As it doesn't seems working…