home *** CD-ROM | disk | FTP | other *** search
/ PC Professionell 2004 December / PCpro_2004_12.ISO / files / webserver / tsw / TSW_3.4.0.exe / Apache2 / perl / HTML2HTML.pm < prev    next >
Encoding:
Perl POD Document  |  2002-06-15  |  1.5 KB  |  75 lines

  1. package DocSet::Doc::HTML2HTML;
  2.  
  3. use strict;
  4. use warnings;
  5.  
  6. use DocSet::Util;
  7.  
  8. use vars qw(@ISA);
  9. require DocSet::Source::HTML;
  10. @ISA = qw(DocSet::Source::HTML);
  11.  
  12. use DocSet::Doc::Common ();
  13. *fetch_pdf_doc_ver = \&DocSet::Doc::Common::fetch_pdf_doc_ver;
  14. *fetch_src_doc_ver = \&DocSet::Doc::Common::fetch_src_doc_ver;
  15.  
  16. sub convert {
  17.     my($self) = @_;
  18.  
  19.     my @body = $self->{parsed_tree}->{body};
  20.     my $vars = {
  21.                 meta => $self->{meta},
  22.                 body => \@body,
  23.                 headers => $self->{parsed_tree}{head},
  24.                 dir  => $self->{dir},
  25.                 nav  => $self->{nav},
  26.                 last_modified => $self->{timestamp},
  27.                 pdf_doc  => $self->fetch_pdf_doc_ver,
  28.                 src_doc  => $self->fetch_src_doc_ver,
  29.                };
  30.     my $tmpl_file = 'page';
  31.     my $mode = $self->{tmpl_mode};
  32.     my $tmpl_root = $self->{tmpl_root};
  33.     $self->{output} = proc_tmpl($tmpl_root, $tmpl_file, $mode, {doc => $vars} );
  34. }
  35.  
  36.  
  37. # need for pluggin docs into index files
  38. sub converted_body {
  39.     my($self) = @_;
  40.  
  41.     return $self->{parsed_tree}->{body};
  42. }
  43.  
  44. 1;
  45. __END__
  46.  
  47. =head1 NAME
  48.  
  49. C<DocSet::Doc::HTML2HTML> - HTML source to HTML target converter
  50.  
  51. =head1 SYNOPSIS
  52.  
  53.  
  54.  
  55. =head1 DESCRIPTION
  56.  
  57. Implements an C<DocSet::Doc> sub-class which converts a source
  58. document in HTML, into an output document in HTML.
  59.  
  60. =head1 METHODS
  61.  
  62. For the rest of the super class methods see C<DocSet::Doc>.
  63.  
  64. =over
  65.  
  66. =item * convert
  67.  
  68. =back
  69.  
  70. =head1 AUTHORS
  71.  
  72. Stas Bekman E<lt>stas (at) stason.orgE<gt>
  73.  
  74. =cut
  75.