Expand PMF_FN_* macros.
[netbsd-mini2440.git] / external / ibm-public / postfix / dist / mantools / postconffix
blob1c70f362d828996f68b5a72ed18cb7b7d8f758a3
1 #!/usr/bin/perl
3 # postconffix - add HTML paragraphs
5 # Basic operation:
7 # - Process input as text blocks separated by one or more empty
8 # (or all whitespace) lines.
10 # - Don't touch blocks that start with `<' in column zero.
12 # The only changes made are:
14 # - Put <p>..</p> around text blocks that start in column zero.
16 # - Put <pre>..</pre> around text blocks that start elsewhere.
18 #use Getopt::Std;
20 #$opt_h = undef;
21 #$opt_v = undef;
22 #getopts("hv");
24 #die "Usage: $0 [-hv]\n" if ($opt_h);
26 #push @ARGV, "/dev/null"; # XXX
28 while(<>) {
30 # Pass through comments and blank linkes before a text block.
31 if (/^(#|\s*$)/) {
32 print;
33 next;
36 # Gobble up the next text block.
37 $block = "";
38 do {
39 $_ =~ s/\s+\n$/\n/;
40 $block .= $_;
41 } while(($_ = <>) && /\S/);
43 # Don't touch a text block starting with < in column zero.
44 if ($block =~ /^</) {
45 print "$block\n";
48 # Meta block.
49 elsif ($block =~ /^%/) {
50 print "$block\n";
53 # Example block.
54 elsif ($block =~ /^\S+\s=/) {
55 print "<pre>\n$block</pre>\n\n";
58 # Pre-formatted block.
59 elsif ($block =~ /^\s/) {
60 print "<pre>\n$block</pre>\n\n";
63 # Paragraph block.
64 elsif ($block =~ /^\S/) {
65 print "<p>\n$block</p>\n\n";
68 # Can't happen.
69 else {
70 die "Unrecognized text block:\n$block";