feat(theme/toc)!: use dynamic toc generation#2018
feat(theme/toc)!: use dynamic toc generation#2018SoonIter merged 7 commits intoweb-infra-dev:mainfrom
Conversation
✅ Deploy Preview for rspress-v2 ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
✅ Deploy Preview for rspress ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
85ba15a to
1c6f4f8
Compare
f6ed54b to
adaca57
Compare
adaca57 to
95ca22d
Compare
|
This is currently an experimental breaking change (OS: lol, a little weird), but it is expected that there will be no large-scale impact, but if there is an impact, it need to be reverted with #2101 At this time, this is a innovative use of mdx that no document site generator has this feature. |
@SoonIter Did you notice this part? We don't want |
I think this issue can be solved with the customizing TOC in #1901, it is on my radar, but I haven't thought about a good configuration interface design yet. |
|
TODO:
There is no block point. I expect to merge this pr first, it has been pending for too long. |
|
It seems this only supports static TOC on the first render, for real dynamic TOC generation, Use case: A dynamic component which fetches data on runtime like https://github.com/alauda/doom/blob/44d293aa9e458b9521dfce9f096442222db15dbb/src/runtime/hooks/useSiteOverrides.ts#L125 |

Summary
this is an associated PR with #2101 of mdx refactoring
Otherwise, the TOC is wrong
and then we get more features
1. dynamic TOC generation even in user's tsx component
https://lynxjs.org/guide/start/integrate-with-existing-apps.html#platform=ios
2. the
<Badge />and more tsc component implementation in TOCRelated Issue
close #1320
close #1560
close #1729
close #2036
Checklist