Skip to main content

Function: orderedList()

orderedList(items)

orderedList(...items): string

Creates an ordered list.

Parameters

• ...items: string[]

Each item in the list.

Returns

string

The ordered list markdown.

Example

console.log(orderedList('item1', 'item2', 'item3'));
// Prints:
//
// 1. item1
//
// 2. item2
//
// 3. item3

Defined in

lib/markdown.ts:547

orderedList(items)

orderedList(items): string

Creates an ordered list.

Parameters

items: string[]

Each item in the list.

Returns

string

The ordered list markdown.

Example

console.log(orderedList('item1', 'item2', 'item3'));
// Prints:
//
// 1. item1
//
// 2. item2
//
// 3. item3

Defined in

lib/markdown.ts:566

orderedList(options, items)

orderedList(options, ...items): string

Creates an ordered list.

Parameters

options: OrderedListOptions

The options for the ordered list. See OrderedListOptions.

• ...items: string[]

Each item in the list.

Returns

string

The ordered list markdown.

Example

console.log(
orderedList(
'item1',
lines(
'item 2',
orderedList({level: 2}, 'item a', 'item b')
),
'item3'
)
);
// Prints:
//
// 1. item1
//
// 2. item2
//
// 1. item a
//
// 2. item b
//
// 3. item3

Defined in

lib/markdown.ts:599

orderedList(options, items)

orderedList(options, items): string

Creates an ordered list.

Parameters

options: OrderedListOptions

The options for the ordered list. See OrderedListOptions.

items: string[]

Each item in the list.

Returns

string

The ordered list markdown.

Example

console.log(
orderedList(
'item1',
lines(
'item 2',
orderedList({level: 2}, 'item a', 'item b')
),
'item3'
)
);
// Prints:
//
// 1. item1
//
// 2. item2
//
// 1. item a
//
// 2. item b
//
// 3. item3

Defined in

lib/markdown.ts:635