gitbook-plugin-parts-autoindex

0.1.0 • Public • Published

Gitbook Plugin Parts Auto Index

A gitbook plugin prepend the index level (from summary) into every h1, h2, ..., title

Install

Add this to your book.json, then run gitbook install:

{
    "plugins": ["parts-autoindex"]
}

Setup

In your book.json add

{
	"pluginsConfig": {
		"parts-autoindex": {
			"level": 2,
			"trim": 1,
			"offset": -1
		}
	}
}

Where:

  • level: [optional, default: 3]. The number until which to prepend the level number eg: 1 = only to h1, 2 = h1, h2, 3 = h1, h2, h3, ...
  • trim: [optional, default: 0]. The amount on numbers to trim from the left from the summary level numbers, eg: 2.3.6 (trim=1) -> 3.6, useful when not using parts
  • offset: [optional, default: 0]. Offset to add/substract from the level, eg: 3.6 (offset=1) -> 4.6, (offset=-1) -> 2.6

Readme

Keywords

none

Package Sidebar

Install

npm i gitbook-plugin-parts-autoindex

Weekly Downloads

1

Version

0.1.0

License

MIT

Last publish

Collaborators

  • m0n0l0c0