Files
Peter Kokot be010b4435 Sync final newlines
- Redundant final newlines trimmed into one
- Missing final newlines added where can be added

According to POSIX, a line is a sequence of zero or more non-' <newline>'
characters plus a terminating '<newline>' character. [1] Files should
normally have at least one final newline character although not
mandatory.

[1] http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap03.html#tag_03_206
2018-10-01 20:21:21 +02:00
..
2018-10-01 20:21:21 +02:00

This tool tries to reconstruct the internal cross references that existed in the Word document that was used to originally create the draft spec.

If we are lucky, this will only need to be run once as we convert from .docx to .md.

We first manually grab all of the section numbers from the Word file and paste them into a CSV-aware file (like an Excel file). Now we have a column of section numbers

Then we run xreference.php. This does the following:

  1. Goes through our Table of Contents and maps, in line order, the current GitHub link anchor to the section number in our CSV file. This is fragile because it assumes that the section numbers in the CSV file map 1:1 in location to that in the ToC.

  2. Then it uses our final CSV mapping to replace the Word section numbers with the numbers and GitHub anchor links.

§11.7.5 => §11_7_5(#the-return-statement)

  1. Optionally, the numbers text can be changed to a constant character string

§11.7.5 => §§(#the-return-statement)