-
-
Notifications
You must be signed in to change notification settings - Fork 140
feat: add toc to readme #573
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
base: main
Are you sure you want to change the base?
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
1 Skipped Deployment
|
| "no_readme": "No README available.", | ||
| "view_on_github": "View on GitHub" | ||
| "view_on_github": "View on GitHub", | ||
| "toc_title": "Outline" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would we like me to add the other langs and try my best, or leave that for others to do?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMO out of scope of this PR
Lunaria Status Overview🌕 This pull request will trigger status changes. Learn moreBy default, every PR changing files present in the Lunaria configuration's You can change this by adding one of the keywords present in the Tracked Files
Warnings reference
|
| // Use scrollTo for precise control | ||
| window.scrollTo({ | ||
| top: targetScrollY, | ||
| behavior: 'smooth', | ||
| }) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried a few scrolling implementations here, I found this was the most reliable. Some other ones occasionally were scrolling up every once in a while in Safari, but not in Firefox/Chrome 🤔
wojtekmaj
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested, works!
How does it feel to be a 10x developer, Sir?
app/composables/useActiveTocItem.ts
Outdated
| let rafId: number | null = null | ||
| const STABLE_THRESHOLD = 5 // Number of frames with no movement to consider settled | ||
|
|
||
| const checkScrollSettled = () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might be easier to leverage scrollend: https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollend_event
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried scrollend in my second attempt actually, and it still had the Safari issue. I might revisit this though.
EDIT: must've been something else I fixed, added this back
| "no_readme": "No README available.", | ||
| "view_on_github": "View on GitHub" | ||
| "view_on_github": "View on GitHub", | ||
| "toc_title": "Outline" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMO out of scope of this PR
Good catch, this was from my first attempt, accident |

Adds an outline to the readme so that users can bounce around more easily. Similar to the Github ToC.
Closes #542