https://github.com/kevinast/gitbook-plugin-folding-menu
GitBook plugin that "tames" large left-nav menus by visualizing one section at a time.
https://github.com/kevinast/gitbook-plugin-folding-menu
Last synced: about 1 year ago
JSON representation
GitBook plugin that "tames" large left-nav menus by visualizing one section at a time.
- Host: GitHub
- URL: https://github.com/kevinast/gitbook-plugin-folding-menu
- Owner: KevinAst
- License: mit
- Created: 2018-09-07T21:18:24.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2018-09-08T20:04:02.000Z (almost 8 years ago)
- Last Synced: 2025-05-09T23:48:51.564Z (about 1 year ago)
- Language: JavaScript
- Size: 13.7 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# gitbook-plugin-folding-menu
This gitbook plugin **manages large left-nav menus** by **visualizing only
one section at a time** _(the active section)_.
[](https://www.npmjs.com/package/gitbook-plugin-folding-menu)
## At a Glance
- [Overview]
- [Install]
- [Configuration]
- [Revision History]
* [v1.0.1] - Added Configuration *(September 8, 2018)*
* [v1.0.0] - Initial Release *(September 7, 2018)*
## Overview
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.
## Install
1. Add the `"folding-menu"` plugin to your **book.json** file:
**book.json**
```js
{
...
"plugins": [
... other plugins you may be using
"folding-menu"
]
...
}
```
2. 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:
```shell
gitbook install
```
- For technical users _(ex: open source documentation)_, install the
plugin to your **devDependencies** as follows:
```shell
npm install --save-dev gitbook-plugin-folding-menu
```
## Configuration
You may optionally supply the following configuration to this plugin:
**book.json**
```js
{
...
"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**
## Revision History
Release | What | *When*
---------|-------------------------------------------------|------------------
[v1.0.1] | Added Configuration | *September 8, 2018*
[v1.0.0] | Initial Release | *September 7, 2018*
### v1.0.1 - Added Configuration *(September 8, 2018)*
[GitHub Content](https://github.com/KevinAst/gitbook-plugin-folding-menu/tree/v1.0.1)
•
[GitHub Release](https://github.com/KevinAst/gitbook-plugin-folding-menu/releases/tag/v1.0.1)
•
[Diff](https://github.com/KevinAst/gitbook-plugin-folding-menu/compare/v1.0.0...v1.0.1)
**NOTE**: This release is a **non-breaking change** _(i.e. no API was affected)_.
- This plugin is now configurable _(see: [Configuration])_.
### v1.0.0 - Initial Release *(September 7, 2018)*
[GitHub Content](https://github.com/KevinAst/gitbook-plugin-folding-menu/tree/v1.0.0)
•
[GitHub Release](https://github.com/KevinAst/gitbook-plugin-folding-menu/releases/tag/v1.0.0)
**This is where it all began ...**
[Overview]: #overview
[Install]: #install
[Configuration]: #configuration
[Revision History]: #revision-history
[v1.0.1]: #v101---added-configuration-september-8-2018
[v1.0.0]: #v100---initial-release-september-7-2018