A gitbook plugin prepend the index level (from summary) into every h1, h2, ..., title
Add this to your book.json
, then run gitbook install
:
{
"plugins": ["parts-autoindex"]
}
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