3.10.1 • Published 5 months ago

markdown-it-book-plugin v3.10.1

Weekly downloads
-
License
ISC
Repository
-
Last release
5 months ago

markdown-it-book-plugin


A markdown-it plugin for book or thesis writers.

Features

  • Auto numbered images npm.io
  • Auto numbered tables npm.io
  • Auto numbered headings npm.io
  • Auto numbered images made by mermaid source code

Installation

yarn add markdown-it-book-plugin

Usage

Basic:

const MarkdownIt = require("markdown-it");
const md = new MarkdownIt();

md.use(require('markdown-it-book-plugin'));

Advanced with options

If you want to prepend the chapter number to the heading, you can use the following options:

const MarkdownIt = require("markdown-it");
const md = new MarkdownIt();

md.use(require('markdown-it-book-plugin'), {
    mainCounterTag: 'h3',
    updateMainCounter: true,
});

You can even customize the counter for each heading, for example, skip the first two chapters:

const MarkdownIt = require("markdown-it");
const md = new MarkdownIt();

md.use(require('markdown-it-book-plugin'), {
    mainCounterTag: 'h3',
    updateMainCounter: ['', '', 1, 2, 3, 4],
});

More examples see

Who is using?

Contributing

  • Fork it!
  • Create your feature branch: git checkout -b my-new-feature
  • Commit your changes: git commit -am 'feat: add some feature'
  • Push to the branch: git push origin my-new-feature
  • Submit a pull request :D

💵 Questions

Feel free to contact me, I'd love to help.

3.10.1

5 months ago

3.10.0

5 months ago

2.7.0

8 months ago

2.6.0

8 months ago

2.9.0

8 months ago

2.8.0

8 months ago

3.9.0

6 months ago

3.8.1

7 months ago

3.4.0

7 months ago

3.3.1

7 months ago

3.3.0

7 months ago

3.2.0

7 months ago

3.1.0

8 months ago

3.8.0

7 months ago

3.7.0

7 months ago

3.6.0

7 months ago

3.5.0

7 months ago

2.9.2

8 months ago

2.9.1

8 months ago

2.9.3

8 months ago

3.0.0

8 months ago

2.5.2

8 months ago

2.5.1

8 months ago

2.5.4

8 months ago

2.5.3

8 months ago

2.3.0

8 months ago

2.2.0

8 months ago

2.5.0

8 months ago

2.4.1

8 months ago

2.4.0

8 months ago

2.1.0

8 months ago

2.0.0

9 months ago

1.6.0

9 months ago

1.5.0

9 months ago

1.4.1

9 months ago

1.4.0

9 months ago

1.3.0

9 months ago

1.2.1

9 months ago

1.2.0

9 months ago

1.1.0

10 months ago

1.0.1

10 months ago

1.0.0

10 months ago