<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-2013.
#
# Usage: README.CONF-html.pl &lt; README.CONF &gt; README.CONF.html
#

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

print "&lt;!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01//EN\" \"http://www.w3.org/TR/html4/strict.dtd\"&gt;\n";
print "&lt;HTML&gt;\n";
print "\n";
print "&lt;HEAD&gt;\n";
print "&lt;TITLE&gt;$title&lt;/TITLE&gt;\n";
print "&lt;/HEAD&gt;\n";
print "\n";
print "&lt;BODY&gt;\n";
print "\n";
print "&lt;h1&gt;$title&lt;/h1&gt;\n";
print "\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&amp;;]+)$/)
     {
      $section = $1;

      if ($section eq "WILDCARD")
        {
         $appendix=1;
        }

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

      print "\n";
      print "&lt;h2 id=\"$section\"&gt;$_&lt;/h2&gt;\n";
      print "\n";
      print "&lt;p&gt;\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=$section."_".$2;

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

      print "\n";
      print "&lt;h3 id=\"$item\"&gt;$_&lt;/h3&gt;\n";
      print "\n";
      print "&lt;p&gt;\n";

      $blank=0;
      $first=1;
     }

   # Item

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

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

      print "\n";
      print "&lt;h3&gt;$_&lt;/h3&gt;\n";
      print "\n";
      print "&lt;p&gt;\n";

      $blank=0;
      $first=1;
     }

   # Blank

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

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

   # Text list

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

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

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

   # Text

   else
     {
      s/^ *//;

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

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

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

print "\n";
print "&lt;/BODY&gt;\n";
print "\n";
print "&lt;/HTML&gt;\n";
</pre></body></html>