Commit bb0a656
authored
fix: align MyST heading slugs with docutils section IDs (#550)
MyST's default slug function uses GitHub-style heading IDs that preserve
leading digits ("3.3 Toolchain Management" -> "33-toolchain-management"),
but Sphinx section IDs are generated by docutils' make_id which strips
them ("toolchain-management"). This mismatch causes spurious
myst.xref_missing warnings on valid [text](file.md#anchor) cross-
references whenever a heading starts with a numeric prefix.
Set myst_heading_slug_func to docutils.nodes.make_id so both sides
agree. Also enable myst_heading_anchors=4 so MyST can resolve heading
cross-references up to h4 depth.
Both settings use config_setdefault, so projects can still override them
in their own conf.py.1 parent 1a1cd79 commit bb0a656
1 file changed
Lines changed: 12 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
64 | 64 | | |
65 | 65 | | |
66 | 66 | | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
67 | 79 | | |
68 | 80 | | |
69 | 81 | | |
| |||
0 commit comments