tscanlin / tocbot

Build a table of contents from headings in an HTML document.
MIT License
1.38k stars 115 forks source link

Is it possible to add expanding option #169

Closed BrambleXu closed 4 years ago

BrambleXu commented 4 years ago

Right now the heads are collapsed. Only when scrolling to into a specific head, the sub-level of heads will expand. I want an option to set all levels to expand.

Below is an expanding example.

image

Reference: https://github.com/blinkfox/hexo-theme-matery/issues/258

tscanlin commented 4 years ago

You can change the collapse depth to 6 and that should handle this. Please comment here if it doesn’t work for you. https://github.com/tscanlin/tocbot/blob/master/src/js/default-options.js#L37