This gitbook plugin manages large left-nav menus by visualizing only one section at a time (the active section).
The high-level points of interest are:
-
On initial display, only the top-level menu items are displayed.
-
Navigating to a section with sub-content will dynamically expand it, collapsing any prior section.
-
The active section will expose the entire sub-menu depth (i.e. all it's ancestry, not just direct children).
-
Navigating between sections continues to expand only the active section (expanding the active section while collapsing any section previously expanded).
-
Animation is used to make the user experience more intuitive (i.e. they can visually see what is happening)!
-
Sections that are composed of multiple pages are supported.
This plugin has the effect of "taming" a big unruly menu structure, by exposing only one section at a time, making it more intuitive for end-user consumption.
You can see this in action at: https://feature-u.js.org/ (one of my open source projects).
This project is a significant improvement on other similar plugins.
-
Add the
"folding-menu"
plugin to your book.json file:book.json
{ ... "plugins": [ ... other plugins you may be using "folding-menu" ] ... }
-
Install the plugin using one of the following options (based on your gitbook usage):
-
For https://legacy.gitbook.com/ usage, plugins are automatically installed.
-
For local gitbook usage run
gitbook install
to install and prepare all plugins for your books:gitbook install
-
For technical users (ex: open source documentation), install the plugin to your devDependencies as follows:
npm install --save-dev gitbook-plugin-folding-menu
-
You may optionally supply the following configuration to this plugin:
book.json
{
...
"pluginsConfig": {
"folding-menu": {
"animationDuration": 500,
"sticky": true
}
}
...
}
-
animationDuration - The animation duration in mills ... use 0 (zero) to disable animation ... DEFAULT: 400
-
sticky - Leave the last section expanded when a the current active section has NO sub-content ... DEFAULT: false
Release | What | When |
---|---|---|
v1.0.1 | Added Configuration | September 8, 2018 |
v1.0.0 | Initial Release | September 7, 2018 |
- This plugin is now configurable (see: Configuration).
GitHub Content • GitHub Release • Diff
NOTE: This release is a non-breaking change (i.e. no API was affected).
GitHub Content • GitHub Release
This is where it all began ...