Skip to content

Commit 7946613

Browse files
committed
fix: wip
1 parent 9db9a71 commit 7946613

25 files changed

+16136
-290
lines changed

.cursor/rules/toc.mdc

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
---
2+
description:
3+
globs:
4+
alwaysApply: false
5+
---
6+
## Update ToC -> `grep`-Sync Markdown TOC
7+
8+
**1. Get Headings:**
9+
10+
```bash
11+
grep -n "^##\\+ " your-file.md
12+
```
13+
14+
(`-n`=line numbers; `^##\\+ `=headings H2-H6).
15+
16+
**2. Analyze & Rebuild TOC:**
17+
Compare `grep` output to your TOC in `your-file.md`. Edit TOC to match `grep` data:
18+
19+
- **Hierarchy Mapping (from `grep` `^##\\+ ` to TOC indent):**
20+
- `##`: `**[Text](#link)**` (0 spaces indent)
21+
- `###`: `- [Text](#link)` (2 spaces indent)
22+
- `####`: `- [Text](#link)` (4 spaces indent)
23+
- (etc., +2 spaces/level, no `**`)
24+
- **Anchor Links (`#link`):** Lowercase heading, spaces to hyphens.
25+
26+
**Example Fix (`cpu-profiling.md` "Data Structure" section):**
27+
`grep` showed `### Dimensions and Time` under `## Data Structure`.
28+
TOC changed from:
29+
30+
```markdown
31+
- **[Data Structure](#data-structure)**
32+
- **[Dimensions and Time](#dimensions-and-time)**
33+
```
34+
35+
To (correctly nested):
36+
37+
```markdown
38+
- **[Data Structure](#data-structure)**
39+
- [Dimensions and Time](#dimensions-and-time)
40+
```

0 commit comments

Comments
 (0)