jhildenbiddle / docsify-themeable

A delightfully simple theme system for docsify.js. Features multiple themes with rich customization options, an improved desktop and mobile experience, and legacy browser support (IE11+).
https://jhildenbiddle.github.io/docsify-themeable
MIT License
535 stars 272 forks source link

Top level sidebar items should always be collapsible #78

Closed hamishwillee closed 2 years ago

hamishwillee commented 2 years ago

On your site pages can be toggled open and closed, but nesting levels that contain pages cannot. I demo this with a slight modification of your sandbox: https://codesandbox.io/s/demo-docsify-themeable-forked-cn8igd?file=/sidebar.md - you cannot compress the sidebar to its minimum.

Is there some trick to getting it to toggle groups of pages too? Might not matter here, but it does in big sidebars like this one: https://hamishwillee.github.io/multidocsify_test/#/v1.15/en/dev_airframes/README

jhildenbiddle commented 2 years ago

Hi @hamishwillee.

The sidebar behavior is controlled by docsify.js. I don't recall all the ins-and-outs of how the sidebar menu works, but the toggle feature you're referring to appears to be available only for toggling the visibility of auto-generated sidebar links based on page headings. This is why you can expand/collapse the "Introduction" sidebar link (the nested navigation is auto-generated based on page headings) but not the "Getting Started" sidebar link (the nest navigation there is hard-coded in your sidebar navigation).

You aren't the first person to request consistent expand/collapse toggles in the sidebar. I believe there's even a plugin available to handle this, although I don't know how well it works with Docsify Themeable (or in general). Best I can suggest is that you make a feature request in the docsify repo.

Sorry I couldn't be more help. Good luck with your project!

hamishwillee commented 2 years ago

@jhildenbiddle Thanks for taking the time to respond, and for the suggestions. I will see if the plugin gives me any joy.