package PodHelp; use strict; use warnings; use utf8; my $rcsid = '$Id: PodHelp.pm,v 1.6 2007/09/16 18:54:42 pippijn Exp $'; use base "Pod::POM::View"; our $subdir; sub view_pod { my ($self, $item) = @_; mkdir "help"; mkdir "help/$subdir"; $item->content->present ($self) } sub view_head1 { my ($self, $item) = @_; my $file; if ($item->title =~ /\|/) { my @cmds = split /\|/, $item->title; for my $cmd (@cmds) { my $content = "Help for \002$cmd\002:\n" . $item->content->present ($self); $content =~ s/\$CMD/$cmd/g; $file = "help/$subdir/" . lc $cmd; $file =~ s/ /_/g; open my $fh, ">", $file; print $fh $content; close $fh; } } else { $file = "help/$subdir/" . lc $item->title; $file =~ s/ /_/g; open my $fh, ">", $file; print $fh "Help for \002", $item->title->present ($self), "\002\n", $item->content->present ($self); close $fh } } sub view_head2 { my ($self, $item) = @_; "\n", $item->title->present ($self), ":", $item->content->present ($self); } sub view_seq_index { "<$_[1]>" } sub view_seq_bold { "\002$_[1]\002" } sub view_seq_space { "[$_[1]]" } sub view_verbatim { "\n$_[1]" } sub view_textblock { "\n$_[1]\n" } sub view_for { my ($self, $item) = @_; my $format = $item->format; my $text = $item->text; $text =~ s/X<([^>]+)>/<$1>/g; $text =~ s/S<([^>]+)>/[$1]/g; "\n$format $text\n" } =head1 AUTHOR Copyright © 2007 Pippijn van Steenhoven =head1 LICENSE This library is free software, you can redistribute it and/or modify it under the terms of the GNU General Public License version 3 or later. =cut 1