yaml / yaml-spec

YAML Specification
http://yaml.org/spec/
348 stars 54 forks source link

Generate heading and <dt> IDs in Python #250

Closed Thom1729 closed 3 years ago

Thom1729 commented 3 years ago

This fixes all of the broken links as a side effect. (Which is why it's marked as a spec change.)

For background, the code in m2d that added IDs to headers broke at some point, presumably when header numbering was moved to the Python script. This was not immediately obvious because Kramdown's automatic header IDs kicked in and worked in many cases, but not in all cases. For unknown reasons, the old link checking code did not detect the broken links, but the more robust link checking code added in #248 did.

The new auto-ID code fixed all of the broken links except for one: syntax-conventions in the links index needed to be changed to production-syntax as a result of #222.

This implementation differs from the original in one important way. The original implementation added empty <div> elements with the autogenerated IDs. This implementation adds the autogenerated IDs to the corresponding <section> element in the case of headings, and for <dt>s directly on that element.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Thom1729 commented 3 years ago

https://spec.yaml.io/pr-250/spec/1.3.0/