Skip to main content

Function: orderedList()

Call Signature

orderedList(...items): string

Defined in: lib/markdown.ts:558

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

Call Signature

orderedList(items): string

Defined in: lib/markdown.ts:577

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

Call Signature

orderedList(options, ...items): string

Defined in: lib/markdown.ts:610

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

Call Signature

orderedList(options, items): string

Defined in: lib/markdown.ts:646

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