Skip to main content

Variable: ol

const ol: {(...items): string; (items): string; (options, ...items): string; (options, items): string; } = orderedList

Defined in: lib/markdown.ts:684

See orderedList.

Call Signature​

(...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

Call Signature​

(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

Call Signature​

(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

Call Signature​

(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