Skip to content

Add manual expand/collapse function for app-sub-sidebar. #1200

@vagra

Description

@vagra

OptionA

Feature request

Add manual expand/collapse function for app-sub-sidebar.

What problem does this feature solve?

Because docsify has been doing this before:

  • when loadSidebar: true, the sidebar hierarchy is:
    • sidebar as root
      • sidebar-nav for _sidebar.md
        • app-sub-sidebar for main content
  • when loadSidebar: false, the sidebar hierarchy is:
    • sidebar as root
      • sidebar-nav for main content
        • does not have app-sub-sidebar

so there is no way to use a unified method to control the expand/collapse for sidebar-nav and app-sub-sidebar, when loadSidebar set to false, the items can't expand/collapse by click.

What does the proposed API look like?

  1. make the app-sub-sidebar can expand/collapse by click.
  2. sidebar of main content can expand/collapse always.
  3. the icon of sidebar items can change display when expand/collapse.

How should this be implemented in your opinion?

  1. change the sidebar hierarchy to:
  • sidebar as root
    • sidebar-nav for _sidebar.md
      • app-sub-sidebar for main content

regardless of whether the loadSidebar set to false or true.

  1. add manual expand/collapse function for app-sub-sidebar.

this making the tree of main content can expand/collapse always.

Are you willing to work on this yourself?

I make some changes at:
vagra@56e643a

when loadSidebar: true, look https://kepan.org/side1/
图片

when loadSidebar: false, look https://kepan.org/side0/
图片

if you guys like it, I can submit a PR.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy