#!/usr/bin/perl -w # # A Perl script for converting pdnsd html documentation to a man page. # # Written by Paul A. Rombouts # # This file Copyright 2004 Paul A. Rombouts # It may be distributed under the GNU Public License, version 2, or # any higher version. See section COPYING of the GNU Public license # for conditions under which this file may be redistributed. # use strict; use POSIX qw(strftime); while(<>) { if(/[^<]*configuration file/i) { last; } } exit unless defined($_); while(<>) { if(/[^<]*layout/i) { last; } } exit unless defined($_); (my $myname=$0) =~ s{.*/}{}; print <) { if(/.*\bpdnsd-ctl\b/) { last; } s{^\s*((?:<[^<>]+>)*?)[\d.]*\s*(.*)((?:<[^<>]+>)*?)(?:
)?\s*$}{.SS $1$2$3\n}i; if(s{^\s*\s*}{.TP\n}i) {$taggedparagraph=1} if(m{^\s*}i) {$taggedparagraph=0} s{^\s*((?:<[^<>]+>)*?)(.*)((?:<[^<>]+>)*?)(?:
)?\s*$}{.B $1$2$3\n}i if $taggedparagraph; s{^\s*((?:<[^<>]+>)*?or(?:<[^<>]+>)*?)(?:
)?\s*$}{$1\n.PD 0\n.TP\n.PD\n}i if $taggedparagraph; if(s{^\s*
}{.DS L\n}i) {$displayed=1}
    s{^\t}{        } if $displayed;
    if(s{
\s*$}{\n.DE\n\n}i) {$displayed=0} elsif(!$displayed) {s{^\s*}{}} s{^\s*
  • }{.IP\n\\(bu }i; s{
  • }{\n.IP\n\\(bu }i; s{
      }{\n}i; s{
    }{\n}i; s{}{\\fB}ig; s{}{\\fP}ig; s{<(i|em)>}{\\fI}ig; s{}{\\fP}ig; unless(s{^\s*(<[^<>]+>)*(
    |

    )(<[^<>]+>)*\s*$}{\n}i) { s{]*>(.*)

    }{\n$1\n}i; s{^\s*
    }{.br\n}i; s{
    \s*
    \s*$}{\n\n}i; s{
    \s*$}{\n.br\n}i; s{
    }{\n.br\n}i; s{^\s*(<[^<>]+>)*\s*$}{}; } s{<[^<>]+>}{}g; s{<}{<}ig; s{>}{>}ig; s{"}{"}ig; s{ }{\\ }ig; s{/var/cache/pdnsd\b}{\@cachedir\@}g; s{(? .UE and was extensively revised by Paul A. Rombouts .UR .UE (for versions 1.1.8b1\\-par and later). .PP Several others have contributed to \\fBpdnsd\\fP; see files in the source or \\fB/usr/share/doc/pdnsd/\\fP directory. .PP This man page was automatically generated from the html documentation for \\fBpdnsd\\fP, using a customized Perl script written by Paul A. Rombouts. ENDOFTRAILER if(defined($_)) { while(<>) { if(/last\s+revised/i) { s{^\s*}{}; s{<[^<>]+>}{}g; s{<}{<}ig; s{>}{>}ig; s{"}{"}ig; s{ }{\\ }ig; print ".PP\n"; print; last; } } } exit;