2 # Copyright (c) 1998-2001 Alessandro Rubini
6 /^%MANPAGE END/ {IN=0; next}
7 /^%MANPAGE/ {IN=1; USELP=NEEDLP=INTABLE=0; NAME=$2; next}
10 /^%MSKIP/ {SKIP=1;next}
13 /^@menu/ {SKIP=1;next}
14 /^@end menu/ {SKIP=0;next}
21 #now perform all the substitutions needed
25 # Use gensub for converting tags: itz Sep 30 1998
27 # However, the gensub function is gawk-specific, and we want things
28 # to work with original-awk too (for portability).
29 # Therefore, use a normal gsub, even though it's a subobptimal solution
30 # as it may step in extra braces. The good solution will be piping to sed,
31 # or match, extract subesxpression, replace, reinsert -- bleah...
34 #$0 = gensub(/@b\{([^}]+)\}/, "\\\\fB\\1\\\\fP","g");
40 #$0 = gensub(/@var\{([^}]+)\}/, "\\\\fI\\1\\\\fP","g");
41 gsub("@var\{","\\fB");
45 /@(samp|code|file)\{/ {
46 #$0 = gensub(/@(samp|code|file)\{([^}]+)\}/, "`\\2'","g");
47 gsub("@(samp|code|file)\{","");
53 gsub(/@xref\{.*\}\./,"");
62 gsub(/@\* */,"\n.br\n");
66 gsub("@[a-z]+\\{","");
70 /^@table/ { TABLE=1; }
71 /^@itemize/ { TABLE=1; next}
75 printf ".TP\n%s\n",$0 > NAME;
79 /^@end table/ {TABLE=0}
80 /^@end itemize/ {TABLE=0}
82 # discard other texinfo commands
86 # manage comments and '%'
92 gsub("[^\\\\]%.*$","");
96 # remove leading blanks
98 /^[ \t]/ {gsub("^[ \t]*","");}
100 # put a .LP at blank lines
105 /^$/ {if (USELP) {NEEDLP++; next;} }
108 /./ { if (NEEDLP) { printf "\n.LP\n" > NAME; NEEDLP=0; } }
112 # Escape single slashes (e.g. in documentation for `-l' command line option)
114 {gsub("\\\\ ", "\\\\ ");}