Platon Technologies
not logged in Login Registration
EnglishSlovak
open source software development celebrating 10 years of open source development! Wednesday, October 14, 2026

Diff for scripts/shell/docbook/db-html2man between version 1.1 and 1.2

version 1.1, 2002/09/02 13:45:35 version 1.2, 2002/09/02 15:05:40
Line 0 
Line 1 
   #!/usr/bin/awk
   
   function handle_table(str)
   {
           entries = 0;
   
           # end of table
           if (sub(/<\/table>/, "</variablelist>")) { return; }
   
           sub(/<table[^>]*>/, "<variablelist>");
           sub(  /<row>/,  "<varlistentry");
           sub(/<\/row>/, "</varlistentry");
   }
   
   # multiline MAN: comment
   /<!-- MAN:$/ {
           while (getline) {
                   if ($0 ~ /^-->$/) break;
                   print;
           }
           next;
   }
   # MAN: on one line
   /<!-- MAN:/ {
           n = split($0, a, "-->");
           for (i = 1; i <= n; i++) {
                   #printf "a[%d] = '%s'\n", i, a[i];
                   if (a[i] ~ /<!-- MAN:/) {
                           sub(/<!-- MAN:/, "", a[i]);
                           sub(/[ \t]+$/, "", a[i]);
                           printf "%s", a[i];
                   }
                   else if (a[i] ~ /<!-- /)
                                   printf "%s -->", a[i];
                           else printf "%s", a[i];
           }
           next;
   }
   
   # remove "<sec1 .*</title>"
   /<sec1/ {
           while (getline) {
                   if (sub(/^.*<\/title>/, "")) { print; break; }
           }
           next;
   }
   
   #/<table / {
   #       handle_table($0);
   #       next;
   #}
   
   # default: print line
   // {
           sub(/<\/sec1>/, "");
           print;
   }
   
   # vim: ft=awk

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2

Platon Group <platon@platon.org> http://platon.org/
Copyright © 2002-2006 Platon Group
Site powered by Metafox CMS
Go to Top