const listitem = require('{%= name %}');
Basic list
Generate a list using default bullets and indentation:
const listitem = require('{%= name %}');
const li = listitem();
let list = ['a', 'b', 'c', 'd', 'e'].map((ele, i) => li(i, ele));
console.log(list.join('\n'));
Results in:
- a
* b
+ c
- d
* e
Roman numerals
Generate roman numerals in increments of 10.
const listitem = require('{%= name %}');
const romanize = require('romanize');
// specify `chars` to pass to fill-range, and use the callback
// to modify generated numerals
const li = listitem({ chars: '1..100..10' }, (indent, ch) => {
return indent + romanize(ch) + '.';
});
// generate a formatted list!
let list = ['a', 'b', 'c', 'd', 'e'].map((ele, i) => li(i, ele));
console.log(list.join('\n'));
Results in:
I. a
XI. b
XXI. c
XXXI. d
XLI. e
{%= apidocs("index.js") %}
Breaking changes
- The callback signature has changed to
(indent, char, level)
.