1 # $Id: faq-txt.awk,v 1.3 2002/09/26 12:37:37 ajhood Exp $
3 function wrap
(line
, prefix
)
8 if (length(line
) < wrapMargin
) {
12 count =
split(line
, words
);
14 indent =
match(line
, /[^
]/)
21 for (w =
1; w
<= count
; w
++) {
22 if (length(result
) + length(words
[w
]) > wrapMargin
- indent
) {
24 print prefix indentStr result
;
30 result = result
" " words
[w
];
33 print prefix indentStr result
;
40 BEGIN { prefixed =
0; pre =
0 }
41 /^PREFIXED$
/ {prefixed =
1; next }
42 /^NOT_PREFIXED$
/ {prefixed =
0; next }
43 /^PRE$
/ {pre =
1; next }
44 /^NOT_PRE$
/ {pre =
0; next }
47 if (prefixed
) print "> " $
0;
50 if (prefixed
) wrap
($
0, "> ");