iPeng6 / docsify-sidebar-collapse

a docsify plugin, support sidebar catalog expand and collapse
MIT License
176 stars 37 forks source link

Feature request: add configuration of sidebar display level #19

Closed nash900 closed 3 years ago

nash900 commented 3 years ago

Current the sidebar will collapse by default to display only level 1 title (level a1, level b1). Does it possible to add a level configuration (1~N) to display level N title? For example if N is two, then sidebar display like this:

Example _sidebar.md:

- Level a1
  - Level a21
  - Level a22
    - Level a31
    - Level a32
- Level b1
  - Level b21
  - Level b22
    - Level b31
    - Level b32

Thanks.

ivandov commented 3 years ago

Came here to request exactly this. Please consider this request.

iPeng6 commented 3 years ago

ok I will think about it asap

iPeng6 commented 3 years ago
<script>
  window.$docsify = {
    ...
    sidebarDisplayLevel: 1, // set sidebar display level
  }
</script>

we can config it like above now,then just refresh your web, use cmd+shift+r / ctrl + f5 to make sure reload without cache

ivandov commented 3 years ago

Works perfectly! Thank you!

nash900 commented 3 years ago

It's so good! Thank you very much!