#!/usr/bin/perl ######################################################################## # dvorak2html - Create a printable HTML page from a Dvorak MUSH # listing (Quick and dirty) # Version 1.0 Thu 22-11-2001 # May be freely distributed and improved upon. # Copyright 2001 by Dion Nicolaas. # # History: # 1.0 22/11/2001 Dion Nicolaas Started ######################################################################## $css = 0; $card = 0; if ($css==0) { print < Printable Dvorak deck EOF } else { print < Printable Dvorak deck
EOF } while (<>) { # parse card def chomp; s/^newcard\s*//; if ($_ eq "" or m/^\@dolist/) { next; } $card++; # Get around slashes in title: no split m/^(.*)\/([ATS])\/(.*)$/; $title = $1; $typeletter = $2; $desc = $3; # set very large descriptions in smaller font if (length($desc) > 300) { $desc = "" . $desc . ""; } # highlight the words "Action" and "Thing" if ($css==0) { $desc =~ s/Action/$&<\/b><\/font>/g; $desc =~ s/Thing/$&<\/b><\/font>/g; } else { $desc =~ s/Action/$&<\/span>/g; $desc =~ s/Thing/$&<\/span>/g; } if ($typeletter eq "A") { $type = "Action"; $tclass = "cardaction"; $tcolour = "#660000"; } elsif ($typeletter eq "T") { $type = "Thing"; $tclass = "cardthing"; $tcolour = "#000066"; } else { $type = "Special"; $tclass = "cardspecial"; $tcolour = "#666666"; } if ($css == 0) { print <
$title

$type
$desc
EOF } else { print <
$title
$type
$desc
EOF } if (($card % 3) == 0) { print < EOF } if (($card % 9) == 0) { if ($css == 0) { print < EOF } else { print <
EOF } } if (($card % 3) == 0) { print < EOF } } print <
EOF