# $Id$ # URL redirector of &My::Web::a_href Perl template. # Copyright (C) 2003-2005 Jan Kratochvil # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; exactly version 2 of June 1991 is required # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA package project::Pod2Html; require 5.6.0; # at least 'use warnings;' but we need some 5.6.0+ modules anyway our $VERSION=do { my @r=(q$Revision$=~/\d+/g); sprintf "%d.".("%03d"x$#r),@r; }; our $CVS_ID=q$Id$; use strict; use warnings; use My::Web; our $HTML_TEST_QUERY_STRING=[ "cvs=captive/src/libcaptive/ke/captivesym.pl", "cvs=macros/AutoGen.pm", ]; sub handler { my $W=My::Web->init( "args_check"=>{ "cvs"=>'^[\w\d][\w\d/.]*$', }, # Requires: Pod::Html patch from: Perl Bug # 37250 # From: # Do not: "content_type"=>"text/html", # or whatever as pod2html(1) already produces XHTML. # Do not: "header_only"=>"xml", # as pod2html(1) already provides the header. "header_only"=>1, # Match the pod2html(1) tag. "charset"=>"utf-8", "http_safe"=>0, # lynx(1) downloads. ); My::Web->heading(); local *F; open F,"lynx -source ".$W->{"project_viewcvs"}."*checkout*/".$W->{"args"}{"cvs"}."?rev=HEAD" # FIXME: "/tmp" - dangerous, not unique, currently creates: pod2htmd.tmp pod2htmi.tmp ." |pod2html --cachedir=/tmp -" ." |"; my $first=; $first=undef() if $first && $W->{"content_type"} eq "text/html" && $first=~/^\Q\E\s*$/s; print $first if $first; print $_ while ; close F; exit; } 1;