diff options
Diffstat (limited to 'Build/source/doc/splitinfo.gawk')
-rw-r--r-- | Build/source/doc/splitinfo.gawk | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/Build/source/doc/splitinfo.gawk b/Build/source/doc/splitinfo.gawk index dd1133fafb4..143b247e038 100644 --- a/Build/source/doc/splitinfo.gawk +++ b/Build/source/doc/splitinfo.gawk @@ -9,24 +9,26 @@ BEGIN { } { - if (/^[*=]+$/) { # starting new chapter or section + if (/^[*]+$/) { # starting new chapter # if we're at the index, quit. if (lastline == "Index") exit (0); - # otherwise ignore unless chapter 2 (don't care about top, index, etc.) - if (lastline !~ /^2/) next; + # move on unless starting a chapter we want (not top, intro, etc.) + if (lastline !~ /^[2-9]/) next; - # ok, we want this. if we had a file open already, close it. + # ok, we want this chapter. if we had a file open already, close it. if (outfile) close (outfile); - # turn section title into filename and start new. + # turn chapter title into filename and start new. outfile = tolower (lastline); # all lowercase - sub ("^2 ", "2.0 overview ", outfile); # consider beginning of chapter as 2.0 - sub ("^2\\.", "", outfile); # remove "2." - sub (" ", "", outfile); # remove first space (after secnum) - sub (" .*", "", outfile); # remove space and everything after, - # leaving just the first word. - outfile = "README." outfile; # prefix "README. + chapnum = substr (outfile, 0, 1); # chapter number + sub ("^. ", "", outfile); # remove chapnum and following space + sub (" .*", "", outfile); # remove next space and everything + # after, leaving just the first word. + + # start numbering the README files at 0. + chapnum = chapnum - 2; + outfile = "README." chapnum outfile; # prefix "README. # print "(This file was generated by makeinfo and splitinfo.gawk.)">outfile; print "(Released under the old-style GNU documentation license;" >outfile; |