Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Kotlin documentation doesn't support tags like '<p>' well

I'm writing doc comments to describe a method.

   /**
     * <p>necessary
     * <p>setType is to set the PendingIntend's request code</p>
     */

But it won't show the paragraphs. If I don't use the <p>, all the documentation is in a line without any break. It works in Java class but when it comes to Kotlin, I don't know how to deal with it.

like image 539
Allen Vork Avatar asked Jan 06 '16 11:01

Allen Vork


People also ask

Does Javadoc work with Kotlin?

The language used to document Kotlin code (the equivalent of Java's Javadoc) is called KDoc. In its essence, KDoc combines Javadoc's syntax for block tags (extended to support Kotlin's specific constructs) and Markdown for inline markup.

How do I add documents to Kotlin?

Documenting Modules and Packages KDoc also supports documenting a package or a module using a custom markdown file. Open module.md in the app module. Replace the contents of the file (the TODO:4 line) with the following: # Module notktx-app ## Description This adds a custom module-level description for the app module.

Which of the following is not a way for creating a comment in Kotlin?

Which of the following is NOT a way for creating a comment in Kotlin? Choose as many answers as you see fit. Add // at the beginning of or inside a line and anything after that // is considered a comment. Put /* or /** to start a block comment, and end it with */.


1 Answers

As said in documentation, KDoc (equivalent of Java’s JavaDoc in Kotlin) utilizes regular Markdown syntax for inline markup instead of HTML tags.

In Markdown, paragraphs are just split by an empty line, like this:

/**
 * necessary
 *
 * setType is to set the PendingIntend's request code
 */

Also, please see this example in the Kotlin reference.

like image 200
hotkey Avatar answered Sep 28 '22 09:09

hotkey