Diff for scripts/shell/docbook/db-html2man between version 1.4 and 1.5
| version 1.4, 2002/09/02 15:54:38 |
version 1.5, 2002/09/02 16:12:49 |
|
|
| #!/usr/bin/awk |
#!/usr/bin/awk |
| |
|
| |
function remove_lines(str) |
| |
{ |
| |
while (getline) { |
| |
if (sub(str, "")) { print; break; } |
| |
} |
| |
return; |
| |
} |
| |
|
| function handle_table(str) |
function handle_table(str) |
| { |
{ |
| entries = 0; |
entries = 0; |
| Line 9 function handle_table(str) |
|
| Line 17 function handle_table(str) |
|
| while (getline) { |
while (getline) { |
| # end of table |
# end of table |
| if (sub(/<\/table>/, "</variablelist>")) { return; } |
if (sub(/<\/table>/, "</variablelist>")) { return; } |
| |
|
| |
if ($0 ~ /<thead>/) { |
| |
remove_lines("^.*<\/thead>"); |
| |
} |
| |
sub(/<tgroup[^>]*>/, ""); |
| |
sub(/<\/tgroup>/, ""); |
| |
sub(/<tbody>/, ""); |
| |
sub(/<\/tbody>/, ""); |
| |
|
| if (sub(/<row>/, "<varlistentry>")) { entries = 0; } |
if (sub(/<row>/, "<varlistentry>")) { entries = 0; } |
| if (sub(/<\/row>/, "</varlistentry>")) { |
if (sub(/<\/row>/, "</varlistentry>")) { |
| Line 61 function handle_table(str) |
|
| Line 77 function handle_table(str) |
|
| next; |
next; |
| } |
} |
| |
|
| # remove "<sect1 .*</title>" |
# remove "<sect1 .*</title>" -- MUST be on begin of the line! |
| /<sect1/ { |
/<sect1/ { |
| while (getline) { |
remove_lines("^.*<\/title>"); |
| if (sub(/^.*<\/title>/, "")) { print; break; } |
|
| } |
|
| next; |
next; |
| } |
} |
| |
|
Platon Group <platon@platon.org> http://platon.org/
|
|