<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">#!/usr/bin/perl

#
# Copyright Andrew M. Bishop 1996.97,98,2001,03.
#
# $Header: /home/amb/CVS/wwwoffle/doc/scripts/README.CONF-msg.pl,v 1.5 2003-06-15 11:08:23 amb Exp $
#
# Usage: README.CONF-msg.pl &lt; README.CONF &gt; messages/README.CONF.txt
#

$_=&lt;STDIN&gt;;
s/^ *//;
s/ *\n//;
$title=$_;

print "TITLE $title\n";
print "HEAD\n";

$hr=1;
$blank=0;
$intro=-1;
$appendix=0;
$first=1;
$dl=0;

while(&lt;STDIN&gt;)
  {
   chop;

   s/&amp;/&amp;amp;/g;
   s/&lt;/&amp;lt;/g;
   s/&gt;/&amp;gt;/g;
   s/ä/&amp;auml;/g;
   s/ö/&amp;ouml;/g;
   s/ü/&amp;uuml;/g;
   s/Ä/&amp;Auml;/g;
   s/Ö/&amp;Ouml;/g;
   s/Ü/&amp;Uuml;/g;
   s/ß/&amp;szlig;/g;

   # Separator

   if ($_ eq "--------------------------------------------------------------------------------")
     {
      $hr=1;
      $intro=0;
     }

   # Underlines

   elsif (m/^ *[-=]+ *$/)
     {
      next;
     }

   # Section heading

   elsif ($hr==1 &amp;&amp; m/^([-A-Za-z0-9]+)$/)
     {
      $section = $1;

      if ($section eq "WILDCARD")
        {
         print "\nTAIL\n";
         $appendix=1;
        }

      $intro=1 if($intro==-1);

      if ($appendix || $intro)
        {
         print "&lt;h2&gt;&lt;a name=\"$section\"&gt;$section&lt;/a&gt;&lt;/h2&gt; ";
        }
      else
        {
         print "\nSECTION $section\n";
        }

      $hr=0;
      $blank=0;
      $first=1;
     }

   # Item

   elsif (!$intro &amp;&amp; !$appendix &amp;&amp; m/^(\[?&amp;lt;URL-SPEC&amp;gt;\]? *)?(.?[-()a-z0-9]+)( *= *.+)?$/)
     {
      $item=$2;
      $item="" if($item =~ m%\(%);

      print "\nITEM $item\n";

      s/&amp;amp;/&amp;/g;
      s/&amp;lt;/&lt;/g;
      s/&amp;gt;/&gt;/g;

      print "$_\n";

      $blank=0;
      $first=1;
     }

   # Item

   elsif (!$intro &amp;&amp; !$appendix &amp;&amp; (m/^(\[!\])?URL-SPECIFICATION/ || m/^\(/))
     {
      $item = "";

      print "\nITEM \n";

      s/&amp;amp;/&amp;/g;
      s/&amp;lt;/&lt;/g;
      s/&amp;gt;/&gt;/g;

      print "$_\n";

      $blank=0;
      $first=1;
     }

   # Blank

   elsif (m/^$/)
     {
      print "&lt;/dl&gt;" if($dl);

      $blank=1 if(!$first);
      $dl=0;
     }

   # Text list

   elsif ($appendix &amp;&amp; m%^([-a-zA-Z0-9():?*/.]+)   +(.+)%)
     {
      $thing=$1;
      $descrip=$2;

      print "&lt;dl&gt;&lt;dt&gt;$thing&lt;dd&gt;$descrip";

      $blank=0;
      $first=0;
      $dl=1;
     }

   # Text

   else
     {
      s/^ *//;

      s%(URL-SPECIFICATION|URL-SPEC)%&lt;a href="/configuration/#URL-SPECIFICATION"&gt;$1&lt;/a&gt;%g;
      s%(WILDCARD)%&lt;a href="/configuration/#WILDCARD"&gt;$1&lt;/a&gt;%g;

      print " " if(!$first);

      print "&lt;p&gt; " if($blank);
      print "$_";

      $blank=0;
      $first=0;
     }
  }

print "\n";
</pre></body></html>