Skip to content

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

License

Notifications You must be signed in to change notification settings

geblanco/gitbook-plugin-parts-autoindex

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

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

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published