Diff for scripts/shell/docbook/db-html2man between version 1.12 and 1.13
| version 1.12, 2002/09/04 02:15:31 |
version 1.13, 2002/09/04 03:30:17 |
| Line 12 function remove_lines(str) |
|
| Line 12 function remove_lines(str) |
|
| |
|
| function handle_man(str) |
function handle_man(str) |
| { |
{ |
| |
n = split(str, a, "-->"); |
| |
for (i = 1; i <= n; i++) { |
| |
#printf "a[%d] = '%s'\n", i, a[i]; |
| |
if (a[i] ~ /<!-- MAN:/) { |
| |
sub(/<!-- MAN:[ \t]+/, "", a[i]); |
| |
sub(/[ \t]+$/, "", a[i]); |
| |
printf "%s", a[i]; |
| |
} |
| |
else if (a[i] ~ /<!-- /) |
| |
printf "%s -->", a[i]; |
| |
else printf "%s", a[i]; |
| |
} |
| } |
} |
| |
|
| function handle_multiline_man() |
function handle_multiline_man() |
| Line 65 function handle_table(str) |
|
| Line 77 function handle_table(str) |
|
| } |
} |
| if ($0 ~ /<!-- MAN:$/) |
if ($0 ~ /<!-- MAN:$/) |
| handle_multiline_man(); |
handle_multiline_man(); |
| |
if ($0 ~ /<!-- MAN:/) |
| |
handle_man($0); |
| |
|
| print; |
print; |
| } |
} |
| Line 77 function handle_table(str) |
|
| Line 91 function handle_table(str) |
|
| } |
} |
| # MAN: on one line |
# MAN: on one line |
| /<!-- MAN:/ { |
/<!-- MAN:/ { |
| n = split($0, a, "-->"); |
handle_man($0); |
| for (i = 1; i <= n; i++) { |
|
| #printf "a[%d] = '%s'\n", i, a[i]; |
|
| if (a[i] ~ /<!-- MAN:/) { |
|
| sub(/<!-- MAN:[ \t]+/, "", a[i]); |
|
| sub(/[ \t]+$/, "", a[i]); |
|
| printf "%s", a[i]; |
|
| } |
|
| else if (a[i] ~ /<!-- /) |
|
| printf "%s -->", a[i]; |
|
| else printf "%s", a[i]; |
|
| } |
|
| next; |
next; |
| } |
} |
| |
|
Platon Group <platon@platon.org> http://platon.org/
|
|