HTML5 Outliner.
npm install document-outlinerA utility to make ol/ul list by using html5 outline algorithm.
Specifications
> Living Standard — Last Updated 11 December 2018
#### via npm
``sh`
npm install document-outliner
#### via yarn
`sh`
yarn add document-outliner
#### vid cdn
`html`
#### via cdn
`html`
`javascript
import DocumentOutliner from 'document-outliner';
const outliner = new DocumentOutliner('.js-outline-src');
outliner.makeList('.js-outline-output', {listType: 'ul'});
`
`javascript`
$(function () {
$('.container').documentOutliner('.output', {link: false});
});
| name | description | default |
|:---|:---|:---|
| link | create HTML anchor link | true |
| listType | HTML list type ('ol'|'ul') | 'ol' |
| listClassName | ol/ul class name | '' |
| itemClassName | li class name | '' |
| linkClassName | link class name | '' |
| anchorName | anchor link name ($1 is to be link number) | 'heading-$1' |
| levelLimit | limit on number of level | 99 |
HTML
`html
Earning money is good.
To earn money you typically need a job.
Spending is what money is mainly used for.
Buying cheap things often not cost-effective.
The most expensive thing is often not the most cost-effective either.
You can lend your money to other people.
If you spend money or invest money, sooner or later you will lose money.
Usually if you lose money it's because you made a mistake.
JavaScript
`javascript
const outliner = new DocumentOutliner('.container');
outliner.makeList('.outline', {
link: true,
listType: 'ul',
listClassName: 'list-group',
itemClassName: 'list-group-item',
anchorName: 'heading-$1'
});
`Yield
`html
The Tax Book
Earning money
Earning money is good.
Getting a job
To earn money you typically need a job.
Spending money
Spending is what money is mainly used for.
Cheap things
Buying cheap things often not cost-effective.
Expensive things
The most expensive thing is often not the most cost-effective either.
Investing money
You can lend your money to other people.
Losing money
If you spend money or invest money, sooner or later you will lose money.
Poor judgement
Usually if you lose money it's because you made a mistake.
``