Skip to main content

Function: unorderedList()

Creates an unordered list.

Example​

console.log(unorderedList('item1', 'item2', 'item3'));
// Prints:
//
// - item1
//
// - item2
//
// - item3

Call Signature​

unorderedList(...items): string

Defined in: lib/markdown.ts:398

Creates an unordered list.

Parameters​

items​

...string[]

Each item in the list.

Returns​

string

The unordered list markdown.

Example​

console.log(unorderedList('item1', 'item2', 'item3'));
// Prints:
//
// - item1
//
// - item2
//
// - item3

Call Signature​

unorderedList(items): string

Defined in: lib/markdown.ts:417

Creates an unordered list.

Parameters​

items​

string[]

Each item in the list.

Returns​

string

The unordered list markdown.

Example​

console.log(unorderedList('item1', 'item2', 'item3'));
// Prints:
//
// - item1
//
// - item2
//
// - item3

Call Signature​

unorderedList(options, ...items): string

Defined in: lib/markdown.ts:450

Creates an unordered list.

Parameters​

options​

UnorderedListOptions

The options for the unordered list. See UnorderedListOptions.

items​

...string[]

Each item in the list.

Returns​

string

The unordered list markdown.

Example​

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

Call Signature​

unorderedList(options, items): string

Defined in: lib/markdown.ts:486

Creates an unordered list.

Parameters​

options​

UnorderedListOptions

The options for the unordered list. See UnorderedListOptions.

items​

string[]

Each item in the list.

Returns​

string

The unordered list markdown.

Example​

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