#!/usr/bin/perl # # $Id: fix-pod-xhtml 10591 2006-03-05 08:22:09Z cmdjb $ # # Format XHTML generated by pod2html (via tidy) for websites # # Usage: pod2html ... MODULE.pm | tidy ... | fix-pod-xhtml OUTPUT-FILE # # Copyright (C) 2001-2004 David Beckett - http://purl.org/net/dajobe/ # Copyright (C) 2001-2004 University of Bristol - http://www.bristol.ac.uk/ # use strict; use File::Basename; my $progname=basename $0; my $main_title="Redland RDF Application Framework"; die "USAGE: $progname OUTPUT-FILE\n" if @ARGV < 1; my $doc_title; my($file)=@ARGV; my($pod_rdf_rel)=($file =~ m%^pod/RDF/%) ? '../' : ''; my($pod_rdf_redland_rel)=($file =~ m%^pod/RDF/Redland/%) ? '' : 'Redland/'; open(OUT, ">$file") or die "$progname: Cannot create $file - $!\n"; print OUT qq{\n}; open(IN, "-"); while() { if(m%(.*?)%) { $doc_title=$1; $doc_title =~ s/^(.*) - Redland (.*) Class$/Perl $1 Class/; s%(.*?)%$main_title - $doc_title%; } next if /^\s*%

%; s%

%%; s%
%%; s%href="/docs/pod/RDF/Redland/([^"]+)"%href="$pod_rdf_redland_rel$1"%g; s%href="/docs/pod/RDF/([^"]+)"%href="$pod_rdf_rel$1"%g; s%^]*>%\n\n

$main_title - $doc_title

\n\n%; s%^

%%; my $year=1900+(localtime)[5]; print OUT <<"EOT" if m%^%;


(C) Copyright 2000-$year Dave Beckett, (C) Copyright 2000-2005 University of Bristol

EOT print OUT; } close(IN); close(OUT);