| 1 | #!/bin/sh |
| 2 | # Script to coordinate parsing of S. Chamberlain source-embedded |
| 3 | # documentation markup language. |
| 4 | |
| 5 | # Four passes: |
| 6 | # 1) awk discards lines not intended for docn, and marks blocks of |
| 7 | # text with comments identifying source file; |
| 8 | # 2) first sed pass interprets Chamberlain markup; |
| 9 | # 3) second sed pass does cleanup that involves merging lines |
| 10 | # 4) third sed pass does remaining cleans up---making {} |
| 11 | # printable within examples, and eliminating empty index entries and |
| 12 | # headings. |
| 13 | #Third and second sed passes are separate because order of execution is hard |
| 14 | #to control otherwise, making one or another of the things involving @example |
| 15 | #inoperative. |
| 16 | |
| 17 | base=`echo $1 | cut -d '.' -f 1` |
| 18 | |
| 19 | awk -f awkscan $1 | \ |
| 20 | sed -f sedscript | \ |
| 21 | sed -f unPROTO | \ |
| 22 | sed -f exmerge | \ |
| 23 | sed -f exfilter >$base.texi |
| 24 | |