-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Better sidebar markup: distinguish content with and without sub sections. #1181
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
Comments
Makes sense. Instead of specifying the collapsable yes/no, perhaps we should allow people to specify the number of sub levels a menu link should display (similar to the subMaxLevel, but that is a global setting for all sidebar links). Setting something like |
Yeah, I think some sort of helper would make sense, especially since Docsify currently can't tell. For now, I may be able to workaround the issue by setting a class , like |
Hmm, actually that's not working for me, EDIT, I tried it even with Docsify's example, I'm think this is a regression. |
I like the
I think this feature is not available for sidebars, @trusktr this will be for v5 right ? |
True, as most features operate on the content area only. However with this particular feature, I tried it in my markdown pages, and also could not get it to work there. It might be a bug. Sidenote, I'm cleaning up my branch; I will separate the changes into separate PRs for eaasier discussion, then go from there (finally!). |
see my demo site: is it you want? source code: it has other features such as:
if you only want |
I write
|
hello. I make some changes for sidebar item: but it only change icons and add expand/collpse function for app-sub-sidebar, not for sidebar-nav. |
This issue has been addressed by PR #2469. The changes will be available when Docsify v5 is released. |
I've been working on my site, gathering ideas.
Feature request
Improvement of markup so that we know if a menu item will have sub-menu items.
What problem does this feature solve?
Currently, Docsify assumes that every top-level menu item must have sub-content, so therefore
docsify-themeable
styles the meny items with the open/close icons. There's no way for docsify-themeable to know if a menu item should not be open/close-able.What does the proposed API look like?
Somehow, the markup should convey whether the menu items will be collapsible or not. This would perhaps add classes in the markup.
How should this be implemented in your opinion?
There's no way for the client-side engine to know ahead of time whether a page will have sub-sections, or not.
Perhaps the only way to do this currently, would be to provide a configuration option, like
Or maybe, we can expand on the sidebar markdown parser to detect a certain syntax (like Docsify does with other links) to tell it which ones are not collapsible:
I think I like the markdown idea more.
This is what my sidebar markdown looks like:
And this is currently what it looks like (work in progress):
The items under
Examples
are all non-collapsible, so I'd like to remove the collapse icons from those. They are the docsify-themeable icons (@jhildenbiddle).What are your thoughts on how to handle this?
The text was updated successfully, but these errors were encountered: