<pre>#!/usr/bin/perl# Copyright (c) 2009 Rob Myers <rob@robmyers.org># Licenced under the GPL version 3 or, at your option, any later version.# Install gut (gutenberg to html converter) into your PATH.# Download the project Gutenberg CD image, decompress it,# add this file to the directory contaning the etext directories and run it.use strict;use warnings;use File::Basename;use Cwd;sub html_name{my $filename = shift @_;$filename =~ s/(.*).txt/$1.html/;$filename;}sub absolute_path{my $file = shift @_;"file://" . Cwd::cwd() . "/" . $file;}sub html_to_pdb{my $file = shift @_;my $absolute_file = absolute_path ($file);my $file_root = basename ($file);system ("plucker-build --zlib-compression --stayonhost --bpp=8 -p./plucker -f $file_root $absolute_file");}sub txt_to_html{my $filename = shift @_;my $htmlname = html_name ($filename);`cat $filename | gut > $htmlname`;}sub process_files{my @txt_files = `ls ./etext*/*.txt`;foreach my $file (@txt_files){chomp ($file);# Don't convert files that have an html versionmy $htmlfile = $file;$htmlfile =~ s/(.*).txt/$1h.htm\*/;if (! -f $htmlfile){txt_to_html ($file);}}my @html_files = `ls etext*/*.html etext*/*.htm`;foreach my $file (@html_files){chomp ($file);html_to_pdb ($file);}}mkdir ("./plucker");process_files ();</pre>
# This may be useful to someone else
Section "InputDevice"
Identifier "Generic Keyboard"
Driver "kbd"
Option "XkbRules" "xorg"
Option "XkbModel" "pc105"
Option "XkbLayout" "gb"
EndSection
Section "InputDevice"
Identifier "Configured Mouse"
Driver "mouse"
EndSection
Section "Device"
Identifier "Configured Video Device"
EndSection
Section "Monitor"
Identifier "Configured Monitor"
EndSection
Section "Screen"
Identifier "Default Screen"
Monitor "Configured Monitor"
EndSection
Section "InputDevice"
Driver "wacom"
Identifier "stylus"
Option "Device" "/dev/input/wacom"
Option "Type" "stylus"
Option "USB" "on"
EndSection
Section "InputDevice"
Driver "wacom"
Identifier "eraser"
Option "Device" "/dev/input/wacom"
Option "Type" "eraser"
Option "USB" "on"
EndSection
Section "InputDevice"
Driver "wacom"
Identifier "cursor"
Option "Device" "/dev/input/wacom"
Option "Type" "cursor"
Option "USB" "on"
EndSection
Section "InputDevice"
Driver "wacom"
Identifier "pad"
Option "Device" "/dev/input/wacom"
Option "Type" "pad"
Option "USB" "on"
EndSection
Section "ServerLayout"
Identifier "Default Layout"
Screen 0 "Default Screen" 0 0
InputDevice "Configured Mouse" "CorePointer"
InputDevice "Generic Keyboard" "CoreKeyboard"
InputDevice "stylus" "SendCoreEvents"
InputDevice "eraser" "SendCoreEvents"
InputDevice "cursor" "SendCoreEvents" # For non-LCD tablets only
# InputDevice "touch" "SendCoreEvents" # Only a few TabletPCs support this type
InputDevice "pad" # For Intuos3/CintiqV5/Graphire4/Bamboo tablets
EndSection
If you have directories containing SVG files that you wish to add to a Subversion repository and you wish them to display as images rather than XML when someone broswes the repository in a web broswer, run the following in the local parent directory then commit it:
svn propset svn:mime-type image/svg+xml */*.svg