Skip to content

Deprecate and remove legacy heading-map: frontmatter format #53

Description

@mmcky

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

  1. 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.)
  2. Set a removal timeline — Target removal in v0.15.0 or later, once all known target repos have been migrated
  3. 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
  4. 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    maintenanceMaintenance tasks on the repository

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions