-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
feat: collapse root sidsebar items #1979
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
Changes from all commits
1dd6544
9792bdc
c962960
b284401
51acd6a
111bc8b
766e5dc
40c9d1e
2daba85
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -258,7 +258,9 @@ export class Compiler { | |
let html = ''; | ||
|
||
if (text) { | ||
html = this.compile(text); | ||
html = this.compile(text) | ||
.replaceAll('<ul >', '<ul class="app-sidebar" >') | ||
.replace('<ul class="app-sidebar" >', '<ul >'); | ||
} else { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. what is this change for ? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. text is the entire compiled html of the sidebar. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
I see, you gonna treat the parent sidebar node as the sub-sidebar of the root Before: After: There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe you could marked those parent sidebar nodes with new style There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In my opinion, implementing it with onClick seems to be a dual implementation method for one feature. |
||
for (let i = 0; i < toc.length; i++) { | ||
if (toc[i].ignoreSubHeading) { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -242,6 +242,7 @@ main.hidden | |
padding-bottom 40px | ||
|
||
li.collapse | ||
.app-sidebar | ||
.app-sub-sidebar | ||
display none | ||
|
||
|