5

Trying to document some Kotlin code with a pretty routine structure:

  1. A numbered list.
    • With a bulleted sublist.
  2. 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 word "list" on the page. Have Googled hither and yon without finding any info on how to do this. Help!

0xbe5077ed
  • 4,565
  • 6
  • 35
  • 77

2 Answers2

9

As far as I can see, nesting with additional indentation of four spaces works:

/**
 * 1. A numbered list.
 *     * With a bulleted sublist.
 * 1. Where the numbers continue correctly at the top level of the list.
 */
val foo: Int = 0

The result is:

enter image description here

hotkey
  • 140,743
  • 39
  • 371
  • 326
1

Dokka uses markdown, which has some forks and flavors and not standardized at all, but this works:

/**
 * list:
 * - item1
 * - item2
 *
 * numbered:
 * 1. one
 * 2. two
 */

this is what it will look like

kocka
  • 657
  • 6
  • 14
  • Correct me if I'm wrong, but based on https://github.com/Kotlin/dokka/blob/c2afb34/core/src/main/kotlin/Markdown/MarkdownProcessor.kt#L52 it looks like Dokka defaults to CommonMark. – Cliabhach Sep 03 '18 at 21:45