4.4.1 • Published 12 months ago

mokuji.js v4.4.1

Weekly downloads
12
License
MIT
Repository
github
Last release
12 months ago

mokuji.js

A table of content JavaScript Library.

Installation

npm install --save mokuji.js

Usage

import { Mokuji } from 'mokuji.js';

const textElement = document.querySelector('.text');
const mokujiList = Mokuji(textElement);

if (!mokujiList) return;

const listElement = document.querySelector('.list');
listElement?.appendChild(mokujiList);

Options

{
  anchorType: true,
  anchorLink: false,
  anchorLinkSymbol: '#',
  anchorLinkBefore: true,
  anchorLinkClassName: '',
}

anchorType

(default: true)

Like Wikipedia's anchor, multibyte characters are replaced by escape sequences.

こんにちは.E3.81.93.E3.82.93.E3.81.AB.E3.81.A1.E3.81.AF

anchorLink

(default: false)

enable/disable the anchor link in the headings

anchorLinkSymbol

(default: '#')

set the anchor link symbol

anchorLinkBefore

(default: true)

set position (before/after) the anchor link in headings.

anchorLinkClassName

(default: '')

set anchor link class name.

4.4.1

12 months ago

4.4.0

12 months ago

4.3.0

1 year ago

4.2.0

2 years ago

3.2.1

2 years ago

3.2.0

2 years ago

4.1.0

2 years ago

4.0.0

2 years ago

3.1.0

3 years ago

3.0.1

3 years ago

3.0.0

4 years ago

2.0.2

4 years ago

2.0.1

5 years ago

2.0.0

5 years ago

1.4.2

6 years ago

1.4.1

6 years ago

1.4.0

6 years ago

1.3.7

6 years ago

1.3.5

6 years ago

1.3.4

7 years ago

1.3.3

7 years ago

1.3.2

7 years ago

1.3.1

7 years ago

1.3.0

7 years ago

1.2.0

7 years ago

1.1.0

7 years ago

1.0.0

7 years ago