/*
* $Id: doc.awk,v 1.13 2007-03-12 15:24:18 bacon Exp $
*
* {License}
*/
global header, mode;
global empty_line_count;
global para_started;
global list_count;
func print_text (full)
{
local fra1, fra2, link, idx, t1, t2;
gsub ("<", "\\<", full);
gsub (">", "\\>", full);
while (match (full, /\{[^{},]+,[^{},]+\}/) > 0)
{
fra1 = substr (full, 1, RSTART-1);
link = substr (full, RSTART, RLENGTH);
fra2 = substr (full, RSTART+RLENGTH, length(full)-RLENGTH);
idx = index(link, ",");
t1 = substr (link, 2, idx-2);
t2 = substr (link, idx+1, length(link)-idx-1);
full = sprintf ("%s%s%s", fra1, t2, t1, fra2);
}
while (match (full, /\[[^\[\][:space:]]+\]/) > 0)
{
fra1 = substr (full, 1, RSTART-1);
link = substr (full, RSTART+1, RLENGTH-2);
fra2 = substr (full, RSTART+RLENGTH, length(full)-RLENGTH);
full = sprintf ("%s%s%s", fra1, link, fra2);
}
while (match (full, /##[^#[:space:]]+##/) > 0)
{
fra1 = substr (full, 1, RSTART-1);
link = substr (full, RSTART+2, RLENGTH-4);
fra2 = substr (full, RSTART+RLENGTH, length(full)-RLENGTH);
full = sprintf ("%s%s%s", fra1, link, fra2);
}
print full;
}
BEGIN {
header = 1;
mode = 0;
empty_line_count = 0;
para_started = 0;
#output=ARGV[0];
#gsub (/\.man/, ".html", output);
#print "OUTPUT TO: " output;
print "