Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API Structures Sidebar Not Alphabetized #408

Open
dsanders11 opened this issue Apr 19, 2023 · 3 comments
Open

API Structures Sidebar Not Alphabetized #408

dsanders11 opened this issue Apr 19, 2023 · 3 comments
Labels
🪲 bug Something isn't working

Comments

@dsanders11
Copy link
Member

New additions to "API Structures" on the sidebar aren't alphabetized, which is confusing since the large majority of them are, and the other sections like modules are alphabetized.

Screenshot 2023-04-18 at 10 12 53 PM

@abhishekgite446
Copy link

abhishekgite446 commented Jun 27, 2023

@dsanders11 Addressed this issue in PR 👍

@ashishsoniii
Copy link

Hey @dsanders11 , I can see two solutions for this issue:

  1. We can sort the items when we are inserting an element into the array, which means changes in scripts/tasks/create-sidebar.ts, runs. (It seems like we have to sort the array every time an element is pushed.)

  2. Alternatively, we can edit theme/DocPage/Layout/index.tsx and sort the array as we fetch all items from sidebar.js. This way, before passing the array to DocPageLayoutSidebar, we can ensure it's sorted. This seems like a better approach as it avoids changing the script of create-sidebar.js, and the sort function won't run unnecessarily multiple times.

Current data is like this

[ 
Main Process Modules :{Array of links(item) - currently sorting these links}, 
Renderer Process Modules : { },
Custom DOM Elements : { }
Chromium and Node.js : { } , 
Classes: { }
] 

So we are already sorting Array of links present inside each element. How about sorting array of Elements also as it is not currently sorted?

I have implemented and tested all of these solutions, and they are working as expected! Let me know your opinion, and then I will proceed to generate a PR.

@botPuneet
Copy link

Hey, @dsanders11 i maded a pr based on your guidance pls review the above pr

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🪲 bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants
@abhishekgite446 @dsanders11 @ashishsoniii @botPuneet and others