Context
In v0.13.0 (#52) we migrated from the flat heading-map: YAML frontmatter block to the structured translation: { title, headings } format. The system currently reads both formats (backward compatible) but always writes the new format.
The lecture-python-programming target repos have been proactively migrated (zh-cn #14, fa #83).
Proposal
- Add a deprecation warning — When
extractHeadingMap() in heading-map.ts falls back to the legacy heading-map: key, log a warning (e.g., ⚠ Legacy heading-map: format detected in <file>. Run 'npx translate headingmap' to migrate.)
- Set a removal timeline — Target removal in v0.15.0 or later, once all known target repos have been migrated
- Remove fallback code — Delete the
?? frontmatter?.['heading-map'] fallback in extractHeadingMap(), the legacy key deletion in injectHeadingMap(), and the heading-map|translation regex in the YAML stripping fallback
- Update docs — Remove references to the old format from
heading-maps.md and tutorials
Files involved
src/heading-map.ts — fallback read + legacy key deletion
docs/user/heading-maps.md — legacy migration note
Context
In v0.13.0 (#52) we migrated from the flat
heading-map:YAML frontmatter block to the structuredtranslation: { title, headings }format. The system currently reads both formats (backward compatible) but always writes the new format.The
lecture-python-programmingtarget repos have been proactively migrated (zh-cn #14, fa #83).Proposal
extractHeadingMap()inheading-map.tsfalls back to the legacyheading-map:key, log a warning (e.g.,⚠ Legacy heading-map: format detected in <file>. Run 'npx translate headingmap' to migrate.)?? frontmatter?.['heading-map']fallback inextractHeadingMap(), the legacy key deletion ininjectHeadingMap(), and theheading-map|translationregex in the YAML stripping fallbackheading-maps.mdand tutorialsFiles involved
src/heading-map.ts— fallback read + legacy key deletiondocs/user/heading-maps.md— legacy migration note