Commit 01f5578
authored
docs: expand details for global CLI anchor links (#2715)
The Global CLI page lists environment-variable headings in its outline
even when the enclosing details block is collapsed. Clicking those links
leaves the content hidden and scrolls to the wrong position.
Add a page-local script that opens enclosing details blocks and scrolls
to the heading with VitePress's configured offset. It handles direct
links, hash changes, and clicking the current outline link again after
collapsing the block, and removes its listeners when leaving the page.
This adapts [VitePress maintainer brc-dd's suggested
script](vuejs/vitepress#4252 (comment))
to headings inside details blocks.
🤖 Generated with Codex1 parent c556257 commit 01f5578
1 file changed
Lines changed: 46 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
1 | 47 | | |
2 | 48 | | |
3 | 49 | | |
| |||
0 commit comments