kotlinformattingcode-documentationkdoc

How to add formatting such as bold, italic, underscore, etc. to Kotlin documenation (KDoc)


I found the page Documenting Kotlin Code in the official Kotlin Reference.

Yet, I could not find out how to highlight certain parts of the documentation, e.g., marking it as italic or bold.

I am new to Kotlin, coming from Java, and have previously only been using JavaDoc, where we used <i> and <b> HTML tags to highlight parts in the documentation.


Solution

  • As I wrote this question, I found the answer to it. Silly me, the link I was looking for even was on the page I referenced in the question.

    So, I will write an answer to my own question, probably someone else can profit from it in the future.

    The documentation states:

    Inline Markup For inline markup, KDoc uses the regular Markdown syntax, extended to support a shorthand syntax for linking to other elements in the code.

    So, to highlight a few points of Markdown: