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.15 and 1.16

version 1.15, 2002/09/04 21:24:55 version 1.16, 2002/09/06 00:38:04
Line 2 
Line 2 
   
 # $Id$  # $Id$
   
   BEGIN {
           read_id(IDfile);
   }
   
   function read_id(file)
   { # {{{
           while (getline tag < file) {
                   n = split(tag, a, "\t+");
                   IDs[a[1]] = tag;
           }
   } # }}}
   
   function get_field(str, i)
   { # {{{
           n = split(IDs[str], a, "\t+");
           return a[i];
   } # }}}
   
   function remove_tag(s, reg)
   { # {{{
                   sub(/\t+/, " ", s);
                   reg1 = sprintf("^.*<%s[^>]*> *", reg);
                   reg2 = sprintf(" *</%s>.*$", reg);
                   if (!sub(reg1, "", s)) { s = ""; }
                   if (!sub(reg2, "", s)) { s = ""; }
   
                   return s;
   } # }}}
   
   function complete_xref(str, reg)
   { # {{{
           reg1 = sprintf("<%s[^>]*>",   reg);
   
           while (str !~ reg1) {
   #               printf "BEFORE = '%s'\n", str;
                   getline;
                   str = sprintf("%s %s", str, $0);
   #               printf "AFTER = '%s'\n", str;
           }
   
           return str;
   
   } # }}}
   
   function handle_xref(str)
   { # {{{
           str = complete_xref(str, "xref");
   # now we substitute tag <xref ...> with apropriate ID
           id = find_id(str);
           sub(/<xref[^>]*>/, sprintf("%s", get_field(id, 5)), str);
           print str;
   } # }}}
   
   # return "endterm" value of <xref ...> tag
   function find_id(str)
   { # {{{
           sub(/^.*<xref.*endterm=['"]/, "", str);
           sub(/['"].*$/, "", str);
           return str;
   } # }}}
   
 function remove_lines(str)  function remove_lines(str)
 { # {{{  { # {{{
         while (getline) {          while (getline) {
Line 81  function handle_table(str)
Line 142  function handle_table(str)
                         handle_man($0);                          handle_man($0);
                         continue;                          continue;
                 }                  }
                   if ($0 ~ /<xref/) {
                           handle_xref($0);
                           continue;
                   }
   
                 print;                  print;
         }          }
Line 97  function handle_table(str)
Line 162  function handle_table(str)
         next;          next;
 }  }
   
   /<xref/ {
           handle_xref($0);
           next;
   }
   
 # remove "<sect1 .*</title>" -- MUST be on begin of the line!  # remove "<sect1 .*</title>" -- MUST be on begin of the line!
 /<sect1/ {  /<sect1/ {
         remove_lines("^.*<\/title>");          remove_lines("^.*<\/title>");

Legend:
Removed from v.1.15  
changed lines
  Added in v.1.16

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