*** empty log message ***
This commit is contained in:
102
ase/rel/doc.awk
102
ase/rel/doc.awk
@ -1,13 +1,17 @@
|
||||
global header, mode;
|
||||
global empty_line_count;
|
||||
global para_started;
|
||||
|
||||
BEGIN {
|
||||
header = 1;
|
||||
mode = 0;
|
||||
empty_line_count = 0;
|
||||
para_started = 0;
|
||||
|
||||
output=ARGV[0];
|
||||
gsub (/\.man/, ".html", output);
|
||||
|
||||
print "OUTPUT TO: " output;
|
||||
#print "OUTPUT TO: " output;
|
||||
|
||||
print "</html>";
|
||||
print "</head>";
|
||||
@ -32,37 +36,91 @@ header && !/^\.[[:alpha:]]+[[:space:]]/ {
|
||||
|
||||
if (mode == 0)
|
||||
{
|
||||
if (/^== [^=]+ ==$/)
|
||||
if (/^$/)
|
||||
{
|
||||
text=substr($0, 3, length($0)-4);
|
||||
print "<h2>" text "</h2>";
|
||||
}
|
||||
else if (/^=== [^=]+ ===$/)
|
||||
{
|
||||
text=substr($0, 4, length($0)-6);
|
||||
print "<h3>" text "</h3>";
|
||||
}
|
||||
else if (/^\{\{\{$/)
|
||||
{
|
||||
print "<pre>";
|
||||
mode = 1;
|
||||
}
|
||||
else if (/^$/)
|
||||
{
|
||||
print "<br>";
|
||||
# empty line
|
||||
if (para_started)
|
||||
{
|
||||
para_started = 0;
|
||||
print "</p>";
|
||||
}
|
||||
empty_line_count++;
|
||||
}
|
||||
else
|
||||
{
|
||||
gsub ("<", "\\<");
|
||||
gsub (">", "\\>");
|
||||
print $0;
|
||||
print "<br>";
|
||||
if (/^= [^=]+ =$/)
|
||||
{
|
||||
if (para_started)
|
||||
{
|
||||
print "</p>";
|
||||
para_started = 0;
|
||||
}
|
||||
text=substr($0, 2, length($0)-2);
|
||||
print "<h1>" text "</h1>";
|
||||
}
|
||||
else if (/^== [^=]+ ==$/)
|
||||
{
|
||||
if (para_started)
|
||||
{
|
||||
print "</p>";
|
||||
para_started = 0;
|
||||
}
|
||||
text=substr($0, 3, length($0)-4);
|
||||
print "<h2>" text "</h2>";
|
||||
}
|
||||
else if (/^=== [^=]+ ===$/)
|
||||
{
|
||||
if (para_started)
|
||||
{
|
||||
print "</p>";
|
||||
para_started = 0;
|
||||
}
|
||||
text=substr($0, 4, length($0)-6);
|
||||
print "<h3>" text "</h3>";
|
||||
}
|
||||
else if (/^==== [^=]+ ====$/)
|
||||
{
|
||||
if (para_started)
|
||||
{
|
||||
print "</p>";
|
||||
para_started = 0;
|
||||
}
|
||||
text=substr($0, 5, length($0)-8);
|
||||
print "<h34" text "</h4>";
|
||||
}
|
||||
else if (/^\{\{\{$/)
|
||||
{
|
||||
# {{{
|
||||
if (para_started)
|
||||
{
|
||||
print "</p>";
|
||||
para_started = 0;
|
||||
}
|
||||
print "<pre>";
|
||||
mode = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!para_started > 0)
|
||||
{
|
||||
print "<p>";
|
||||
para_started = 1;
|
||||
}
|
||||
|
||||
gsub ("<", "\\<");
|
||||
gsub (">", "\\>");
|
||||
print $0;
|
||||
print "<br>";
|
||||
}
|
||||
|
||||
empty_line_count = 0;
|
||||
}
|
||||
}
|
||||
else if (mode == 1)
|
||||
{
|
||||
if (/^}}}$/)
|
||||
{
|
||||
# }}}
|
||||
print "</pre>";
|
||||
mode = 0;
|
||||
}
|
||||
|
Reference in New Issue
Block a user