#!/usr/bin/perl # This expects the WebTK directory to be beside the # SampleBook directory use lib ".."; use WebTK::Document; my $arg; my ($format, $file); for $arg ( @ARGV ) { if ( substr ($arg, 0, 1) eq "-" ) { $format = substr ($arg, 1); } else { $file = $arg; } } if ( ! -e $file ) { print "Usage: mkbook.pl \n"; print "format is one of: -epub, -text, -html, -rtf, -kindle\n"; exit 0; } $doc = WebTK::Document->new (); $doc->load_file ($file); print $doc->render ($format);