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
5
votes
1 answer

Documenting Ktor routes with KDoc

Does anyone know whats the correct way to document Ktor routes, aiming to show it on KDoc? Example: route(DogoBot.data.API.ROUTE){ route("token"){ route("add"){ get("fromdiscord") { ... } get { ... } } …
NathanPB
  • 685
  • 1
  • 7
  • 22
5
votes
2 answers

How do I make a nested list in Dokka?

Trying to document some Kotlin code with a pretty routine structure: A numbered list. With a bulleted sublist. Where the numbers continue correctly at the top level of the list. What I take to be the official Dokka page doesn't even have the…
0xbe5077ed
  • 4,565
  • 6
  • 35
  • 77
5
votes
0 answers

KDoc Annotations not rendered in Dokka generated HTML

I am currently testing the Dokka documentation and some of the annotations I have made are not being rendered. Here are my findings: Classes don't show @sample, and html tags

,

: See SimpleCalculator class documentation If a…
Paula Kristin
  • 813
  • 2
  • 11
  • 27
4
votes
0 answers

Image in Kotlin Kdoc in Android

In JavaDoc you can add an image like this: /** * ...The following legend explains these diagrams: * */ public class Test…
Ultimo_m
  • 4,724
  • 4
  • 38
  • 60
4
votes
2 answers

Include Kotlin/Native KDocs documentation in built .frameworks for iOS/XCode

I'm developing a Kotlin/Native library for both iOS and Android. When running ./gradlew assemble I get the release/debug .frameworks with Obj-C Headers. I can use these .frameworks fine. But I would also like to carry on with documentation of…
4
votes
0 answers

Documenting Kotlin code: How to create a table?

I have read this article about documenting Kotlin code and this article as well. I tried this code: /** * | First Header | Second Header | * | ------------- | ------------- | * | Content Cell | Content Cell | * | Content Cell | Content Cell…
Anggrayudi H
  • 14,977
  • 11
  • 54
  • 87
4
votes
3 answers

How Do I skip a line in kDoc

In my kDoc I want an empty line between paragraphs. How do I accomplish that? (Also is there a complete guide somewhere? Such as how to create tables, bullets, etc?)
salyela
  • 1,325
  • 3
  • 14
  • 26
4
votes
1 answer

Kotlin - @hide javadoc equivalent

I'm trying to hide a method that should be visible only for test usage. Is there any equivalent for javadoc's @hide I'm not an expert using KDoc neither JavaDoc, If I'm missing any concept please point me to it. /** @hide */ fun methodToHide() :…
crgarridos
  • 8,758
  • 3
  • 49
  • 61
4
votes
1 answer

kotlin unresolved KDoc link but IntelliJ doesn't like the import that fixes it

import abc.MyClass.MyEnum; /// from Java /** * [MyClass.MyEnum] */ class efg () : MyClass.MyEnum { return MyClass.MyEnum.BiGNUMBER; } I have something similar to the above in IntelliJ... but it will identify the import as unused - so…
ycomp
  • 8,316
  • 19
  • 57
  • 95
3
votes
0 answers

kdoc link to local file so that link works in Android Studio

In Kotlin doc comments I can link to a website /** * [go to this website](https://www.google.com) */ I can link to a class /** * [look at this class][SomeClass] */ But how can I link to a file in the repository such that clicking it in Android…
Max
  • 21,123
  • 5
  • 49
  • 71
3
votes
1 answer

How to enforce complete documentation on Kotlin code

What plugin or tool should I use to enforce complete kdoc documentation on new Kotlin code? Java code is checked by checkstyle with Sun's rule set, I need a Kotlin's analogue for it.
andreoss
  • 1,570
  • 1
  • 10
  • 25
3
votes
1 answer

How to use Dokka to generate Docs like Kotlinlang.org

AFAIK Kotlin's Documentation was made using Dokka. But the Examples stated in Dokka's Readme is only generating ultra basic webpages/markdown files with no elegance whatsoever. It just looks like this Here's another one by Atrium, docs link. I'm…
Zonily Jame
  • 5,053
  • 3
  • 30
  • 56
3
votes
1 answer

Document template generation kotlin

Working before in Android Studio if before the function I put / ** and hit enter, then I automatically generated the next document with annotations for describing the parameters, the return value, etc. /** * @params a * @return */ int f(int a) { …
Aksenov Vladimir
  • 677
  • 1
  • 6
  • 16
3
votes
1 answer

Dokka uses fully qualified class names

I'm using dokka to auto generate javadoc for me. Though when it encounters any class not from my project it uses fully qualified names. Is it possible to use only class names and make dokka provide a link for it? For example: java.lang.String…
Mibac
  • 8,990
  • 5
  • 33
  • 57
3
votes
1 answer

What is the correct name for Kotlin inline documentation?

Since KDoc documentation generation engine is abandoned in favor of Dokka, should Kotlin documentation be referred to as "KDoc comments", or as "Dokka comments"?
gvlasov
  • 18,638
  • 21
  • 74
  • 110