Skip to content

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

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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