Use the appropriate documentation format for the target programming language. In Kotlin files, use KDoc formatting instead of Javadoc formatting for consistency and proper tooling support.
Use the appropriate documentation format for the target programming language. In Kotlin files, use KDoc formatting instead of Javadoc formatting for consistency and proper tooling support.
Key differences:
[ClassName]
instead of {@link ClassName}
for type references[Runnable]
instead of {@code Runnable}
for code references[setApplication]
not [.setApplication]
)Example:
// โ Incorrect (Javadoc style in Kotlin)
/**
* Throws an {@link AssertionException} if the current thread is not the UI thread.
* Before calling build, the following must be called:
* * [.setApplication]
*/
// โ
Correct (KDoc style in Kotlin)
/**
* Throws an [AssertionException] if the current thread is not the UI thread.
* Before calling build, the following must be called:
* * [setApplication]
*/
This ensures documentation renders correctly in IDEs and documentation generators, and maintains consistency with language conventions.
Enter the URL of a public GitHub repository