Pod-Tree-1.25/000755 000765 000024 00000000000 12530636570 013324 5ustar00gaborstaff000000 000000 Pod-Tree-1.25/.perlcriticrc000644 000765 000024 00000001072 12530624556 016013 0ustar00gaborstaff000000 000000 # please alpha sort config items as you add them severity = 4 theme = core verbose = %f: [%p] %m at line %l, column %c.\n [Objects::ProhibitIndirectSyntax] severity = 5 [-InputOutput::RequireBriefOpen] [-Modules::ProhibitMultiplePackages] [-Modules::RequireEndWithOne] [-Modules::RequireExplicitPackage] [-Subroutines::ProhibitBuiltinHomonyms] [-Subroutines::RequireArgUnpacking] [-Subroutines::RequireFinalReturn] [-ValuesAndExpressions::ProhibitCommaSeparatedStatements] [-ValuesAndExpressions::ProhibitConstantPragma] [-Variables::RequireLocalizedPunctuationVars] Pod-Tree-1.25/.perltidyrc000644 000765 000024 00000000153 12526576126 015512 0ustar00gaborstaff000000 000000 -pbp -nst -et=4 --maximum-line-length=120 # Break a line after opening/before closing token. -vt=0 -vtc=0 Pod-Tree-1.25/.tidyallrc000644 000765 000024 00000000271 12526576602 015320 0ustar00gaborstaff000000 000000 [PerlTidy] select = {lib,t}/**/*.{pl,pm,t} select = Makefile.PL select = {mod2html,podtree2html,pods2html,perl2html} argv = --profile=$ROOT/.perltidyrc [SortLines] select = .gitignore Pod-Tree-1.25/Changes000644 000765 000024 00000020341 12530636471 014617 0ustar00gaborstaff000000 000000 Revision history for Perl extension Pod::Tree 1.25 2015.05.25 - Rename test files to have number prefix. - Move test reqirements to TEST_REQUIRES or BUILD_REQUIRES for older EUMM - Older versions of EU::MM require quotes around 2-dot versions (CHORNY) 1.24 2015.05.22 - Include the rc files in the distribution to use the proper Perl::Critic configuration. - use Test::Version to make sure we have the same version number in every module. - Configure Perl::Critic to be level 4. - Lots of other refactorings. 1.23 2015.05.20 - Add version numbers to all the pm files. 1.22 2015.05.20 - Refactoring code: 3 argument open, no bareword filehandles - Refactoring code: convert indirect calls to direct calls - Add optional test using Test::Perl::Critic - Fix missing file issue introduced in 1.21 - Include the Test::Comile based test 1.21 2015.05.20 - More tests (use Test::Compile) - Refactoring code (use Path::Tiny) - Run perltidy on the code. - Separate packages to their own files. - Add use warnings; use strict; remove use diagnostics; - Remove remaining use 5.... statements. 1.20 2015.05.19 - Refactor test script to use Test::More 1.19 2015.05.18 - Include link to VCS, Bug tracking system, hopepage. 1.18 2015.05.18 - Just to let PAUSE index it. 1.17_01 2015.05.18 - New maintainer (SZABGAB) 1.17 2010 Jun 21 pods2html - quote paths in REs 1.16 2009 Apr 10 Pod::Tree::HTML - fix to work with IO::File 1.13 (RT 34755, 38307) mod2html - added to distribution Makefile.PL - added all required modules to PREREQ_PM 1.15 2007 Jun 24 Rename pod2html -> podtree2html (RT 18742) Pod::Tree::HTML - Changed destination resolution to accept a scalar reference, or anything with a 'print' method. (RT 12335) podtree2html, pods2html - documented HTML elements for CSS rules (RT 6118) pod.css - add example style sheet 1.14 2007 Jun 12 Pod::Tree::HTML - remove use vars qw(&isa); (RT 14530) - document translate() error conditions (RT 12336) Makefile.PL - add Text::Template prerequisite (RT 26440) 1.13 2007 Apr 06 Pod::Tree - rename the Stream package Pod::Tree::HTML - change the X<> markup to render as empty, per the perlpod manpage - rename the BitBucket package - add template support Pod::Tree:PerlUtil - handle malformed NAME paragraphs more gracefully pod2html - add template support pods2html - add template support 1.12 2006 Apr 22 Pod::Tree::PerlBin - ignore non-existant directories on $PATH - protect File::Find::find from empty directory list Pod::Tree:PerlFunc - find the pod/ directory under either perl/ or perl/lib/ (Win32 issue) Pod::Tree::PerlLib - increase default col_width to 30 Pod::Tree:PerlTop - find the pod/ directory under either perl/ or perl/lib/ (Win32 issue) Pod::Tree:PerlUtil - clean up whitespace in module names and descriptions pods2html - recursion check compares absolute paths instead of inodes (Win32 issue) t/pods2html.t - use rmtree instead of system "rm -r" (Win32 issue) 1.11 2004 Oct Pod::Tree - recognize blank lines per perlpodspec - added support for =head3 and =head4 commands - recognize \n, \r, \r\n line endings - separate paragraphs on blank (/^\s*$/) lines Pod::Tree::HTML - added support for =head3 and =head4 commands - expose the emit_toc and emit_body methods - drop the tags in the TOC. It was the easiest way to fix the nesting problem. - added { empty => 1 } option Pod::Tree::Node - added support for =head3 and =head4 commands - consolidate consecutive verbatim paragraphs pods2html - added --module option - get depth from module name, not file path - added --empty option t/pod2html.t t/pods2html.t - invoke $Config{perlpath}, not 'perl' GENERAL - Set default BGCOLOR to ffffff - Removed all the use 5.x; require 5.x statements - reviewed all the copyright notices 1.10 2003 Jan Pod::Tree - documentation typos - dropped the require 5.6.0; statement Pod::Tree::HTML - added support for $link_map->url methods - deprecated $link_map->map methods - exposed escape_2396 and assemble_url methods - documentation Pod::Tree::Node - documentation typos Pod::Tree::Pod - dropped the require 5.6.0; statement t/mapper.t t/mapper.d - created 1.09 2002 Jul Makefile.PL - traded in ABSTRACT for ABSTRACT_FROM Pod::Tree::Node - recoded _unescape_text to use Pod::Escapes - expand the HTTP domain to include e.g. mailto: Pod::Tree::Pod - changed _escape to handle non-ASCII chars Pod::Tree::PerlUtils - Handle module names that contain dashes Pod::Tree::HTML - Handle PODs that have "name--description" with multiple dashes - Change default bgcolor to white - added css => $url option perl2html - traded in hard-coded /:/ for /$Config{path_sep}/ pod2html - added -css URL option pods2html - added -css URL option - fixed recursion check on Win32 t/pod2html.d t/pod2html.t - created t/pods2html.t - enable some tests on Win32 - wrote RDiff() to ignore CVS directories 1.08 2001 May 30 t/pods2html.t - skip test on Win32 1.07 2001 May 29 Makefile.PL - added EXE_FILES key - added PREREQ_PM key Pod::Tree - preserve paragraph endings - preserve non-POD content - added has_pod() method Pod::Tree::Node - added code() and is_code() - added get_brackets() method - added get_raw() method - added clone() method - added set_filename()/get_filename() methods - added get_domain() and support for L - carry =pod and =cut in command nodes - SplitBar() split(/\|/,,2) to protect links with a verbar Pod::Tree:HTML - fixed load_paragraphs() call in resolve_source() - added depth option - render =for image foo.gif as - rewhacked _emit_link to support target domains Pod::Tree::Pod - correctly reconstructs L<> markups Pod::Tree::PerlDist - added perl* links for the README.* files Pod::Tree::PerlFunc - fixed ShiftItems() to handle the getpw* items in perlfunc.pod Pod::Tree::PerlTop - added _get_dist_links() to pick up the README.* files pods2html - fixed relative links - don't translate foo.pm if foo.pod exists - works if HTMLDir is a subdir of PodDir - create HTMLDir with File::Path::mkpath t/ - moved all the test files into .d/ directories 1.06 2000 Oct 17 Added Pod::Tree::Pod Pod::Tree::Node - fixed SpitBar() 1.05 2000 Oct 12 Pod::Tree::Node - Added $VERSION to quiet CPAN.pm 1.04 2000 Oct 11 Pod::Tree::HTML - Added $VERSION to quiet CPAN.pm 1.03 2000 Oct 09 - Cleaned up $VERSION variables (we hope) Pod::Tree::HTML - fixed \$pod bug in new() Pod::Tree::PerlBin - fixed xsubpp bug Pod::Tree::PerlFunc - fixed to handle do() properly Pod::Tree::PerlPod - compress whitespace in description lines pods2html - Fixed to handle relative paths perl2html - Fixed to handle relative paths 1.02 2000 May 19 Pod::Tree::Node - added support for x<<>> style markups Pod::Tree::PerlFunc - added
tags to lists in perlfunc.pod sub-pages - sort function names within alphebetical index paragraphs Pod::Tree::PerlLib - scan for .pod files under @INC - added stop_file list Pod::Tree::PerlPod - don't convert PODs under /ext/ 1.01 2000 Mar 11 Pod::Tree - added limit => n option - added get_root(), set_root() - added push(), pop() - added walk() Pod::Tree::Node - allow text items to begin with * or number - parse L as "sec tion" in this man page - close line breaks in L<> markups Pod::Tree::HTML - emit

and tags - suppress

markups from a single ordinary list item - changed _escape_text() to conform to RFC 2369 - added linkMap => \&linkMap option - added link() constructor - close line breaks in markups - emit anchors for
items in
lists - accept =for HTML or =for html - emit

around =for HTLM paragraphs Makefile.PL - add DISTNAME key pod2html - fixed the shebang pods2html - fixed the shebang - added --index option Added - Pod::Tree::PerlBin - Pod::Tree::PerlDist - Pod::Tree::PerlFunc - Pod::Tree::PerlLib - Pod::Tree::PerlMap - Pod::Tree::PerlPod - Pod::Tree::PerlTop - Pod::Tree::PerlUtil - perl2html - ToDo 1.00 1999 Jun 23 - original version; created by h2xs 1.18 Pod-Tree-1.25/lib/000755 000765 000024 00000000000 12530636570 014072 5ustar00gaborstaff000000 000000 Pod-Tree-1.25/Makefile.PL000644 000765 000024 00000003265 12530602743 015277 0ustar00gaborstaff000000 000000 use 5.006; use strict; use warnings; use ExtUtils::MakeMaker; # See lib/ExtUtils/MakeMaker.pm for details of how to influence # the contents of the Makefile that is written. my %config = ( NAME => 'Pod::Tree', VERSION_FROM => 'lib/Pod/Tree.pm', # finds $VERSION DISTNAME => 'Pod-Tree', ( $] >= 5.005 ? ( ABSTRACT_FROM => 'lib/Pod/Tree.pm', AUTHOR => 'Steven McDougall (swmcd@world.std.com)' ) : () ), ( $ExtUtils::MakeMaker::VERSION >= 6.3002 ? ( 'LICENSE' => 'perl' ) : () ), clean => { FILES => "t/pod2html.d/*.html* t/pods2html.d/A t/pods2html.d/html_act* t/pods2html.d/podR/HTML t/*/*.act lib/Pod/Tree/*~" }, dist => { COMPRESS => 'gzip --best', SUFFIX => '.gz' }, EXE_FILES => [qw(mod2html podtree2html pods2html perl2html)], PREREQ_PM => { 'File::Find' => 1, 'HTML::Stream' => 1.49, 'IO::File' => 1, 'IO::String' => 1, 'Pod::Escapes' => 1.02, 'Text::Template' => 1, }, ( eval { ExtUtils::MakeMaker->VERSION(6.46) } ? ( META_MERGE => { 'meta-spec' => { version => 2 }, resources => { repository => { type => 'git', url => 'http://github.com/szabgab/Pod-Tree.git', web => 'http://github.com/szabgab/Pod-Tree', }, bugtracker => { web => 'http://github.com/szabgab/Pod-Tree/issues', }, homepage => 'http://metacpan.org/pod/Pod::Tree', }, } ) : () ) ); my %test_requires = ( 'Test::More' => 1, 'Test::Compile' => '1.2.1', 'Path::Tiny' => 0.068, ); if ( eval { ExtUtils::MakeMaker->VERSION(6.64) } ) { $config{TEST_REQUIRES} = \%test_requires; } else { $config{BUILD_REQUIRES} = \%test_requires; } WriteMakefile(%config); Pod-Tree-1.25/MANIFEST000644 000765 000024 00000010610 12530626465 014455 0ustar00gaborstaff000000 000000 Changes MANIFEST META.yml META.json Makefile.PL README ToDo ToDo.Not lib/Pod/Tree.pm lib/Pod/Tree/BitBucket.pm lib/Pod/Tree/HTML.pm lib/Pod/Tree/HTML/PerlTop.pm lib/Pod/Tree/HTML/LinkMap.pm lib/Pod/Tree/Node.pm lib/Pod/Tree/PerlBin.pm lib/Pod/Tree/PerlDist.pm lib/Pod/Tree/PerlFunc.pm lib/Pod/Tree/PerlLib.pm lib/Pod/Tree/PerlMap.pm lib/Pod/Tree/PerlPod.pm lib/Pod/Tree/PerlTop.pm lib/Pod/Tree/PerlUtil.pm lib/Pod/Tree/Pod.pm lib/Pod/Tree/StrStream.pm lib/Pod/Tree/Stream.pm mod2html perl2html pod.css pods2html podtree2html skeleton t/cut.d/cut.pod t/cut.d/file0.exp t/cut.d/file1.exp t/cut.d/fileU.exp t/cut.d/string0.exp t/cut.d/string1.exp t/cut.d/stringU.exp t/html.d/base.exp t/html.d/body.exp t/html.d/cut.exp t/html.d/cut.pod t/html.d/depth.exp t/html.d/empty.pod t/html.d/for.exp t/html.d/for.pod t/html.d/link.exp t/html.d/link.pod t/html.d/list.exp t/html.d/list.pod t/html.d/paragraph.exp t/html.d/paragraph.pod t/html.d/sequence.exp t/html.d/sequence.pod t/html.d/toc.exp t/load.d/list.exp t/load.d/list.pod t/mapper.d/cut.exp t/mapper.d/cut.pod t/mapper.d/for.exp t/mapper.d/for.pod t/mapper.d/link.exp t/mapper.d/link.pod t/mapper.d/list.exp t/mapper.d/list.pod t/mapper.d/paragraph.exp t/mapper.d/paragraph.pod t/mapper.d/sequence.exp t/mapper.d/sequence.pod t/option.d/base.pod t/option.d/baseD.exp t/option.d/baseU.exp t/option.d/hr.pod t/option.d/hr0.exp t/option.d/hr1.exp t/option.d/hr2.exp t/option.d/hr3.exp t/option.d/toc.pod t/option.d/toc0.exp t/option.d/toc1.exp t/pod.d/cut.pod t/pod.d/for.pod t/pod.d/link.pod t/pod.d/list.pod t/pod.d/paragraph.pod t/pod.d/sequence.pod t/pod2html.d/cut.exp t/pod2html.d/cut.exp_t t/pod2html.d/cut.exp_tv t/pod2html.d/cut.pod t/pod2html.d/for.exp t/pod2html.d/for.exp_t t/pod2html.d/for.exp_tv t/pod2html.d/for.pod t/pod2html.d/link.exp t/pod2html.d/link.exp_t t/pod2html.d/link.exp_tv t/pod2html.d/link.pod t/pod2html.d/list.exp t/pod2html.d/list.exp_t t/pod2html.d/list.exp_tv t/pod2html.d/list.pod t/pod2html.d/paragraph.exp t/pod2html.d/paragraph.exp_t t/pod2html.d/paragraph.exp_tv t/pod2html.d/paragraph.pod t/pod2html.d/sequence.exp t/pod2html.d/sequence.exp_t t/pod2html.d/sequence.exp_tv t/pod2html.d/sequence.pod t/pod2html.d/template.txt t/pod2html.d/values.pl t/pods2html.d/empty_exp/A.html t/pods2html.d/empty_exp/A/B.html t/pods2html.d/empty_exp/C.html t/pods2html.d/empty_exp/C/D.html t/pods2html.d/empty_exp/C/D/E.html t/pods2html.d/empty_exp/empty.html t/pods2html.d/html_exp/A.html t/pods2html.d/html_exp/A/B.html t/pods2html.d/html_exp/C.html t/pods2html.d/html_exp/C/D.html t/pods2html.d/html_exp/C/D/E.html t/pods2html.d/html_exp_t/A.html t/pods2html.d/html_exp_t/A/B.html t/pods2html.d/html_exp_t/C.html t/pods2html.d/html_exp_t/C/D.html t/pods2html.d/html_exp_t/C/D/E.html t/pods2html.d/html_exp_tv/A.html t/pods2html.d/html_exp_tv/A/B.html t/pods2html.d/html_exp_tv/C.html t/pods2html.d/html_exp_tv/C/D.html t/pods2html.d/html_exp_tv/C/D/E.html t/pods2html.d/pod/A.pm t/pods2html.d/pod/A.pod t/pods2html.d/pod/A/B.pod t/pods2html.d/pod/C.pod t/pods2html.d/pod/C/D.pod t/pods2html.d/pod/C/D/E.pod t/pods2html.d/pod/empty.pod t/pods2html.d/podR/A.pm t/pods2html.d/podR/A.pod t/pods2html.d/podR/A/B.pod t/pods2html.d/podR/C.pod t/pods2html.d/podR/C/D.pod t/pods2html.d/podR/C/D/E.pod t/pods2html.d/podR_exp/A.pm t/pods2html.d/podR_exp/A.pod t/pods2html.d/podR_exp/A/B.pod t/pods2html.d/podR_exp/C.pod t/pods2html.d/podR_exp/C/D.pod t/pods2html.d/podR_exp/C/D/E.pod t/pods2html.d/podR_exp/HTML/A.html t/pods2html.d/podR_exp/HTML/A/B.html t/pods2html.d/podR_exp/HTML/C.html t/pods2html.d/podR_exp/HTML/C/D.html t/pods2html.d/podR_exp/HTML/C/D/E.html t/pods2html.d/template.txt t/pods2html.d/values.pl t/template.d/cut.exp t/template.d/cut.pod t/template.d/for.exp t/template.d/for.pod t/template.d/link.exp t/template.d/link.pod t/template.d/list.exp t/template.d/list.pod t/template.d/paragraph.exp t/template.d/paragraph.pod t/template.d/sequence.exp t/template.d/sequence.pod t/template.d/template.txt t/tree.d/code.pm t/tree.d/cut.exp t/tree.d/cut.pod t/tree.d/empty.pod t/tree.d/for.exp t/tree.d/for.pod t/tree.d/link.exp t/tree.d/link.pod t/tree.d/list.exp t/tree.d/list.pod t/tree.d/paragraph.exp t/tree.d/paragraph.pod t/tree.d/sequence.exp t/tree.d/sequence.pod t/10-cut.t t/11-html.t t/12-load.t t/13-mapper.t t/14-option.t t/15-pod.t t/16-pod2html.t t/17-pods2html.t t/18-template.t t/19-tree.t t/00-compile.t t/94-version.t t/95-tidyall.t t/96-perl-critic.t .perlcriticrc .perltidyrc .tidyallrc Pod-Tree-1.25/META.json000644 000765 000024 00000003042 12530636570 014744 0ustar00gaborstaff000000 000000 { "abstract" : "Create a static syntax tree for a POD", "author" : [ "Steven McDougall (swmcd@world.std.com)" ], "dynamic_config" : 1, "generated_by" : "ExtUtils::MakeMaker version 7.04, CPAN::Meta::Converter version 2.150001", "license" : [ "perl_5" ], "meta-spec" : { "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec", "version" : "2" }, "name" : "Pod-Tree", "no_index" : { "directory" : [ "t", "inc" ] }, "prereqs" : { "build" : { "requires" : { "ExtUtils::MakeMaker" : "0" } }, "configure" : { "requires" : { "ExtUtils::MakeMaker" : "0" } }, "runtime" : { "requires" : { "File::Find" : "1", "HTML::Stream" : "1.49", "IO::File" : "1", "IO::String" : "1", "Pod::Escapes" : "1.02", "Text::Template" : "1" } }, "test" : { "requires" : { "Path::Tiny" : "0.068", "Test::Compile" : "v1.2.1", "Test::More" : "1" } } }, "release_status" : "stable", "resources" : { "bugtracker" : { "web" : "http://github.com/szabgab/Pod-Tree/issues" }, "homepage" : "http://metacpan.org/pod/Pod::Tree", "repository" : { "type" : "git", "url" : "http://github.com/szabgab/Pod-Tree.git", "web" : "http://github.com/szabgab/Pod-Tree" } }, "version" : "1.25" } Pod-Tree-1.25/META.yml000644 000765 000024 00000001511 12530636570 014573 0ustar00gaborstaff000000 000000 --- abstract: 'Create a static syntax tree for a POD' author: - 'Steven McDougall (swmcd@world.std.com)' build_requires: ExtUtils::MakeMaker: '0' Path::Tiny: '0.068' Test::Compile: v1.2.1 Test::More: '1' configure_requires: ExtUtils::MakeMaker: '0' dynamic_config: 1 generated_by: 'ExtUtils::MakeMaker version 7.04, CPAN::Meta::Converter version 2.150001' license: perl meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.4.html version: '1.4' name: Pod-Tree no_index: directory: - t - inc requires: File::Find: '1' HTML::Stream: '1.49' IO::File: '1' IO::String: '1' Pod::Escapes: '1.02' Text::Template: '1' resources: bugtracker: http://github.com/szabgab/Pod-Tree/issues homepage: http://metacpan.org/pod/Pod::Tree repository: http://github.com/szabgab/Pod-Tree.git version: '1.25' Pod-Tree-1.25/mod2html000644 000765 000024 00000007777 12527111670 015012 0ustar00gaborstaff000000 000000 #!/usr/local/bin/perl use strict; use warnings; use File::Find; use File::Path; use Getopt::Long; use HTML::Stream; use IO::File; use Pod::Tree::HTML; my %Options = ( bgcolor => '#ffffff' ); my %Index; my $ok = GetOptions( \%Options, "base:s", "css:s", "index:s", "toc!", "hr:i", "bgcolor:s", "text:s" ); $ok or die "Bad command line options\n"; my ( $ModDir, $HTMLDir ) = @ARGV; $HTMLDir or die "mod2html modDir HTMLDir\n"; $ModDir =~ s( /$ )()x; $HTMLDir =~ s( /$ )()x; mkpath($HTMLDir); my $HTML_inode = ( stat $HTMLDir )[1]; umask 0022; find( { wanted => \&Translate, no_chdir => 1 }, $ModDir ); Index() if $Options{index}; sub Translate { -d and &Translate_Dir; -f and &Translate_POD; } sub Translate_Dir { my $dir = $File::Find::name; my $inode = ( stat $dir )[1]; # always 0 on Win32 if ( $inode and $inode == $HTML_inode ) { $File::Find::prune = 1; return; } $dir =~ s/^$ModDir/$HTMLDir/o; -d $dir or mkdir $dir, 0755 or die "Can't mkdir $dir: $!\n"; print "$File::Find::name\n"; } sub Translate_POD { m( \.(pm|pod)$ )x or return; my $source = $File::Find::name; Hidden($source) and return; print "$source\n"; my $dest = $source; $dest =~ s/^$ModDir/$HTMLDir/; $dest =~ s( \.\w+$ )(.html)x; my $depth = Depth($source); my $pod = $source; $pod =~ s(^$ModDir/)(); $pod =~ s( \.\w+$ )()x; $Index{$pod} = 1; my $html = Pod::Tree::HTML->new( $source, $dest ); $html->set_options( %Options, depth => $depth ); $html->translate; } sub Hidden { my $source = shift; $source =~ m(\.pm$) or return 0; $source =~ s(\.pm$)(.pod); -e $source; } sub Depth { my $path = shift; $path =~ s(^$ModDir/)(); my @path = split m(/), $path; @path - 1; } sub Index { my $index = "$HTMLDir/index.html"; my $fh = IO::File->new(">$index"); defined $fh or die "Can't open $index: $!\n"; my $stream = HTML::Stream->new($fh); my $title = $Options{index}; my $bgcolor = $Options{bgcolor}; my $text = $Options{text}; $stream->HTML->HEAD; $stream->TITLE->text($title)->_TITLE; $stream->_HEAD->BODY( BGCOLOR => $bgcolor, TEXT => $text ); $stream->H1->t($title)->_H1; Emit_Entries($stream); $stream->_BODY->_HTML; } sub Emit_Entries { my $stream = shift; $stream->UL; for my $entry ( sort keys %Index ) { $stream->LI->A( HREF => "$entry.html" )->t($entry)->_A->_LI; } $stream->_UL; } __END__ =head1 NAME mod2html - translate module PODs to HTML =head1 SYNOPSIS C [C<--base> I] [C<--css> I] [C<--index> I] [C<-->[C<no>]C<toc>] [C<--hr> I<level>] [C<--bgcolor> I<#rrggbb>] [C<--text> I<#rrggbb>] I<modDir> I<HTMLdir> =head1 DESCRIPTION C<mod2html> locates all the PODs under I<modDir> translates them to HTML, and writes them to a directory tree under F<HTMLdir>. The directory tree maps the module namespaces. It makes the HTML files world-readable. =head1 OPTIONS =over 4 =item C<--base> I<url> Translate C<LE<lt>E<gt>> sequences into HTML links relative to I<url>. =item C<--css> I<url> Specifies a Cascanding Style Sheet for the generated HTML page. =item C<--index> I<title> Writes an index of all the HTML files to I<HTMLDir>F</index.html>. I<title> is used as the title of the index page. =item C<-->[C<no>]C<toc> Includes or omits the table of contents. Default is to include the TOC. =item C<--hr> I<level> Controls the profusion of horizontal lines in the output, as follows: level horizontal lines 0 none 1 between TOC and body 2 after each =head1 3 after each =head1 and =head2 Default is level 1. =item C<--bgcolor> I<#rrggbb> Set the background color to I<#rrggbb>. Default is white. =item C<--text> I<#rrggbb> Set the text color to I<#rrggbb>. Default is black. =back =head1 REQUIRES L<C<Pod::Tree::HTML>> =head1 SEE ALSO L<C<pod2html>>, L<C<pods2html>>, L<C<Pod::Tree::HTML>> =head1 AUTHOR Steven McDougall, <swmcd@world.std.com> =head1 COPYRIGHT Copyright (c) 2003 by Steven McDougall. This program is free software; you can redistribute it and/or modify it under the same terms as Perl. �Pod-Tree-1.25/perl2html�����������������������������������������������������������������������������000755 �000765 �000024 �00000006737 12527111670 015173� 0����������������������������������������������������������������������������������������������������ustar�00gabor���������������������������staff���������������������������000000 �000000 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/local/bin/perl use strict; use warnings; use Config; use Getopt::Long; use Pod::Tree::PerlBin; use Pod::Tree::PerlDist; use Pod::Tree::PerlFunc; use Pod::Tree::PerlLib; use Pod::Tree::PerlMap; use Pod::Tree::PerlPod; use Pod::Tree::PerlTop; my %Opts; $Opts{toc} = 1; my $ok = GetOptions( \%Opts, "v:i", "toc!", "hr:i", "bgcolor:s", "text:s" ); $ok or die "Bad command line options\n"; my ( $Perl_Dir, $HTML_Dir ) = @ARGV; $HTML_Dir or die "perl2html Perl_Dir HTML_Dir\n"; $Perl_Dir =~ s( /$ )()x; $HTML_Dir =~ s( /$ )()x; $| = 1; umask 0022; -d $HTML_Dir or mkdir $HTML_Dir, 0777 or die "Can't mkdir $HTML_Dir: $!\n"; my ($Perl_Map); my ( $Perl_Bin, $Perl_Dist, $Perl_Func, $Perl_Lib, $Perl_Pod, $Perl_Top ); $Perl_Map = Pod::Tree::PerlMap->new; $Perl_Bin = Pod::Tree::PerlBin->new( $Perl_Dir, $HTML_Dir, $Perl_Map, %Opts ); $Perl_Dist = Pod::Tree::PerlDist->new( $Perl_Dir, $HTML_Dir, $Perl_Map, %Opts ); $Perl_Func = Pod::Tree::PerlFunc->new( $Perl_Dir, $HTML_Dir, $Perl_Map, %Opts ); $Perl_Lib = Pod::Tree::PerlLib->new( $Perl_Dir, $HTML_Dir, $Perl_Map, %Opts ); $Perl_Pod = Pod::Tree::PerlPod->new( $Perl_Dir, $HTML_Dir, $Perl_Map, %Opts ); $Perl_Top = Pod::Tree::PerlTop->new( $Perl_Dir, $HTML_Dir, $Perl_Map, %Opts ); $Perl_Pod->scan; $Perl_Bin->scan( split /$Config{path_sep}/, $ENV{PATH} ); $Perl_Dist->scan; $Perl_Func->scan; $Perl_Lib->scan(@INC); $Perl_Bin->index; $Perl_Dist->index; $Perl_Func->index; $Perl_Lib->index; $Perl_Pod->index; $Perl_Top->index( $Perl_Top, $Perl_Pod, $Perl_Lib, $Perl_Bin, $Perl_Dist ); $Perl_Bin->translate; $Perl_Dist->translate; $Perl_Func->translate; $Perl_Lib->translate; $Perl_Pod->translate; $Perl_Top->translate; __END__ =head1 NAME perl2html - generate Perl documentation in HTML =head1 SYNOPSIS B<perl2html> [B<-->[B<no>]B<toc>] [B<--hr> I<level>] [B<--bgcolor> B<#>I<rrggbb>] [B<--text> B<#>I<rrggbb>] [B<--v> I<verbosity>] I<PerlDir> I<HTMLDir> =head1 DESCRIPTION B<perl2html> translates Perl documentation to HTML. I<PerlDir> is the root of the Perl source tree. The HTML pages are organized into a directory tree rooted at I<HTMLDir>. A top-level index is written to I<HTMLDir>C</index.html> In addition to the Perl sources, B<perl2html> searches C<@INC> for module PODs, and C<$ENV{PATH}> for program PODS. All the HTML pages are created world-readable. I<Perldir> and I<HTMLDir> must be absolute path names. =head1 OPTIONS =over 4 =item C<-->[C<no>]C<toc> Includes or omits a table of contents in each page. Default is to include the TOC. =item C<--hr> I<level> Controls the profusion of horizontal lines in the output, as follows: level horizontal lines 0 none 1 between TOC and body 2 after each =head1 3 after each =head1 and =head2 Default is level 1. =item C<--bgcolor> I<#rrggbb> Set the background color to I<#rrggbb>. Default is off-white. =item C<--text> I<#rrggbb> Set the text color to I<#rrggbb>. Default is black. =item C<--v> I<verbosity> Verbosity level: 0, 1, 2, 3 =back =head1 REQUIRES Perl 5 L<C<Getopt::Long>>, =head1 SEE ALSO L<C<pods2html>>, L<C<Pod::Tree>>, L<C<Pod::Tree::HTML>>, L<C<Pod::Tree::PerlBin>>, L<C<Pod::Tree::PerlDist>>, L<C<Pod::Tree::PerlFunc>>, L<C<Pod::Tree::PerlLib>>, L<C<Pod::Tree::PerlMap>>, L<C<Pod::Tree::PerlPod>>, L<C<Pod::Tree::PerlTop>> =head1 AUTHOR Steven McDougall, swmcd@world.std.com =head1 COPYRIGHT Copyright 2000 by Steven McDougall. This program is free software; you can redistribute it and/or modify it under the same terms as Perl. ���������������������������������Pod-Tree-1.25/pod.css�������������������������������������������������������������������������������000644 �000765 �000024 �00000001022 11167777054 014623� 0����������������������������������������������������������������������������������������������������ustar�00gabor���������������������������staff���������������������������000000 �000000 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* Example style sheet for pod*2html converters */ a:link { background: #ff8080 } body { background: #f0f0f0 } code { background: #c0ffc0 } dd { background: #ffffe0 } dl { background: #fffff0 } dt { background: #ffffc0 } h1 { background: #ffc0c0 } h2 { background: #ffe0e0 } hr { background: #ff0000; height: 5px } i { background: #ffc0c0 } li { background: #e0e0e0 } ol { background: #fff0ff } p { background: #f0f0ff } pre { background: #f0fff0 } ul { background: #f0ffff } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������Pod-Tree-1.25/pods2html�����������������������������������������������������������������������������000755 �000765 �000024 �00000015715 12527111670 015172� 0����������������������������������������������������������������������������������������������������ustar�00gabor���������������������������staff���������������������������000000 �000000 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/local/bin/perl use strict; use warnings; use File::Find; use File::Path; use Getopt::Long; use HTML::Stream; use IO::File; use Pod::Tree::HTML; use File::Spec; my %Options = ( bgcolor => '#ffffff', text => '#000000', hr => 1, toc => 1 ); my $ok = GetOptions( \%Options, "base:s", "css:s", "bgcolor:s", "empty", "index:s", "module", "text:s", "toc!", "hr:i", "variables:s" ); $ok or die "Bad command line options\n"; my %Index; my @Dirs; my ( $PodDir, $HTMLDir, $Template, @Variables ) = @ARGV; $HTMLDir or die "pods2html PodDir HTMLDir\n"; $PodDir = canonpath File::Spec $PodDir; $HTMLDir = rel2abs File::Spec $HTMLDir; mkpath($HTMLDir); do $Options{variables} if $Options{variables}; for (@Variables) { chomp; my ( $name, $value ) = split /=/, $_, 2; $name =~ s(^\$)(); ${ $Pod::Tree::HTML::{$name} } = $value; } umask 0022; find( { wanted => \&Translate, no_chdir => 1 }, $PodDir ); Index() if $Options{index}; Cleanup() unless $Options{empty}; sub Translate { -d and &Translate_Dir; -f and &Translate_POD; } sub MkDir { my $dir = shift; -d $dir and return; mkdir $dir, 0755 or die "Can't mkdir $dir: $!\n"; push @Dirs, $dir; } sub Translate_Dir { my $dir = $File::Find::name; if ( $HTMLDir eq rel2abs File::Spec $dir) { $File::Find::prune = 1; return; } if ( $Options{module} and ( m(/t$) or m(/blib$) ) ) { $File::Find::prune = 1; return; } $dir =~ s/^\Q$PodDir/$HTMLDir/o; -d $dir or MkDir $dir; print "$File::Find::name\n"; } sub Translate_POD { m( \.(pm|pod)$ )x or return; my $source = $File::Find::name; Hidden($source) and return; print "$source\n"; my $dest = $source; $dest =~ s/^\Q$PodDir/$HTMLDir/o; $dest =~ s( \.\w+$ )(.html)x; my $depth = Depth($source); my $pod = $source; $pod =~ s(^$PodDir/)(); $pod =~ s( \.\w+$ )()x; $Index{$pod} = 1; my $html = Pod::Tree::HTML->new( $source, $dest, %Options ); $html->set_options( depth => $depth ); $html->translate($Template); } sub Hidden { my $source = shift; $source =~ m(\.pm$) or return 0; $source =~ s(\.pm$)(.pod); -e $source; } sub Depth { my $source = shift; my $tree = Pod::Tree->new; $tree->load_file($source); my $children = $tree->get_root->get_children; my @pod = grep { is_pod $_ } @$children; my $node1 = $pod[1]; $node1 or return ''; my $text = $node1->get_deep_text; my ($name) = split m(\s+-+\s+), $text; $name =~ s(^\s+)(); my @name = split /::/, $name; @name - 1; } sub Index { my $index = "$HTMLDir/index.html"; my $fh = IO::File->new(">$index"); defined $fh or die "Can't open $index: $!\n"; my $stream = HTML::Stream->new($fh); my $title = $Options{index}; my $bgcolor = $Options{bgcolor}; my $text = $Options{text}; $stream->HTML->HEAD; $stream->TITLE->text($title)->_TITLE; $stream->_HEAD->BODY( BGCOLOR => $bgcolor, TEXT => $text ); $stream->H1->t($title)->_H1; Emit_Entries($stream); $stream->_BODY->_HTML; } sub Emit_Entries { my $stream = shift; $stream->UL; for my $entry ( sort keys %Index ) { $stream->LI->A( HREF => "$entry.html" )->t($entry)->_A->_LI; } $stream->_UL; } sub Cleanup { while (@Dirs) { my $dir = pop @Dirs; rmdir $dir; # does nothing unless $dir is empty } } __END__ =head1 NAME pods2html - translate a tree of PODs to HTML =head1 SYNOPSIS C<pods2html> [C<--base> I<url>] [C<--css> I<url>] [C<--empty>] [C<--index> I<title>] [C<--module>] [C<-->[C<no>]C<toc>] [C<--hr> I<level>] [C<--bgcolor> I<#rrggbb>] [C<--text> I<#rrggbb>] [C<--variables> I<values.pl>] I<PODdir> I<HTMLdir> [F<template> [I<variable>=I<value> ...]] =head1 DESCRIPTION C<pods2html> finds all the F<.pod> and F<.pm> files in the directory tree rooted at I<PODdir>. It translates each POD to HTML, and writes it to a parallel directory tree rooted at I<HTMLdir> It makes the HTML files world-readable. If a F<template> file is provided, then F<template> will be filled in by the C<Text::Template> module and written to F<dest>. Here is a minimal template, showing all the variables that are set by C<pods2html>. <html> <head> <base href="{$base}"> <link href="{$css}" rel="stylesheet" type="text/css"> <title>{$title} {$toc} {$body} If the C<--variables> option is provided, then the file I will be executed with a C call before the template is filled in. I may contain arbitrary Perl code. The program fragments in the template are evaulted in the C package. Any variables that I sets in this package will be available to the template. Additional scalar variables may be set on the command line with the I=I syntax. Variables set on the command line override variables set in I. =head1 OPTIONS =over 4 =item C<--base> I Specifies a base URL for HTML links. =item C<--css> I Specifies a Cascanding Style Sheet for the generated HTML pages. Here are example rules for all the different HTML elements that may appear in a POD. a:link { background: #ff8080 } body { background: #f0f0f0 } code { background: #c0ffc0 } dd { background: #ffffe0 } dl { background: #fffff0 } dt { background: #ffffc0 } h1 { background: #ffc0c0 } h2 { background: #ffe0e0 } hr { background: #ff0000; height: 5px } i { background: #ffc0c0 } li { background: #e0e0e0 } ol { background: #fff0ff } p { background: #f0f0ff } pre { background: #f0fff0 } ul { background: #f0ffff } =item C<--empty> Creates HTML files for empty PODs. If this option is not provided, then no HTML file is created for empty PODs. =item C<--index> I Writes an index of all the HTML files to I<HTMLDir>F</index.html>. I<title> is used as the title of the index page. =item C<--module> Ignores files in directories named F<t/> and F<blib/>. Useful for translating PODs in a module development directory. =item C<-->[C<no>]C<toc> Includes or omits the table of contents. Default is to include the TOC. =item C<--hr> I<level> Controls the profusion of horizontal lines in the output, as follows: level horizontal lines 0 none 1 between TOC and body 2 after each =head1 3 after each =head1 and =head2 Default is level 1. =item C<--bgcolor> I<#rrggbb> Set the background color to I<#rrggbb>. Default is white. =item C<--text> I<#rrggbb> Set the text color to I<#rrggbb>. Default is black. =back =head1 REQUIRES L<C<Pod::Tree::HTML>>, L<C<HTML::Stream>> =head1 BUGS The recursion check doesn't work on Win32. This means that the program will enter an infinite recursion if I<HTMLdir> is a subdirectory of I<PODdir>. =head1 SEE ALSO L<C<pod2html>>, L<C<Pod::Tree::HTML>> =head1 AUTHOR Steven McDougall, <swmcd@world.std.com> =head1 COPYRIGHT Copyright (c) 1999-2010 by Steven McDougall. This program is free software; you can redistribute it and/or modify it under the same terms as Perl. ���������������������������������������������������Pod-Tree-1.25/podtree2html��������������������������������������������������������������������������000755 �000765 �000024 �00000007720 12527111532 015661� 0����������������������������������������������������������������������������������������������������ustar�00gabor���������������������������staff���������������������������000000 �000000 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/local/bin/perl use strict; use warnings; use Getopt::Long; use Pod::Tree::HTML; my %Options; $Options{toc} = 1; my $ok = GetOptions( \%Options, "base:s", "css:s", "toc!", "hr:i", "bgcolor:s", "text:s", "variables:s" ); $ok or die "Bad command line options\n"; umask 0022; @ARGV < 2 and die "podtree2html PODfile HTMLfile [templateFile]\n"; my ( $source, $dest, $template, @variables ) = @ARGV; my $html = Pod::Tree::HTML->new( $source, $dest ); $html->set_options(%Options); do $Options{variables} if $Options{variables}; for (@variables) { chomp; my ( $name, $value ) = split /=/, $_, 2; $name =~ s(^\$)(); ${ $Pod::Tree::HTML::{$name} } = $value; } $html->translate($template); __END__ =head1 NAME podtree2html - translate a POD to HTML =head1 SYNOPSIS C<podtree2html> [C<--base> I<url>] [C<--css> I<url>] [C<-->[C<no>]C<toc>] [C<--hr> I<level>] [C<--bgcolor> I<#rrggbb>] [C<--text> I<#rrggbb>] [C<--variables> I<values.pl>] F<source> F<dest> [F<template>] [I<variable>=I<value> ...]] =head1 DESCRIPTION C<podtree2html> reads the POD in file F<source>, translates it to HTML, and writes it to file F<dest>. F<dest> is created world-readable. If a F<template> file is provided, then F<template> will be filled in by the C<Text::Template> module and written to F<dest>. Here is a minimal template, showing all the variables that are set by C<podtree2html>. <html> <head> <base href="{$base}"> <link href="{$css}" rel="stylesheet" type="text/css"> <title>{$title} {$toc} {$body} If the C<--variables> option is provided, then the file I will be executed with a C call before the template is filled in. I may contain arbitrary Perl code. The program fragments in the template are evaulted in the C package. Any variables that I sets in this package will be available to the template. Additional scalar variables may be set on the command line with the I=I syntax. Do not prefix I with a C<$> sigil. Variables set on the command line override variables set in I. =head1 OPTIONS =over 4 =item C<--base> I Translate CE> sequences into HTML links relative to I. =item C<--css> I Specifies a Cascanding Style Sheet for the generated HTML page. Here are example rules for all the different HTML elements that may appear in a POD. a:link { background: #ff8080 } body { background: #f0f0f0 } code { background: #c0ffc0 } dd { background: #ffffe0 } dl { background: #fffff0 } dt { background: #ffffc0 } h1 { background: #ffc0c0 } h2 { background: #ffe0e0 } hr { background: #ff0000; height: 5px } i { background: #ffc0c0 } li { background: #e0e0e0 } ol { background: #fff0ff } p { background: #f0f0ff } pre { background: #f0fff0 } ul { background: #f0ffff } =item C<-->[C]C Includes or omits the table of contents. Default is to include the TOC. =item C<--hr> I Controls the profusion of horizontal lines in the output, as follows: level horizontal lines 0 none 1 between TOC and body 2 after each =head1 3 after each =head1 and =head2 Default is level 1. =item C<--bgcolor> I<#rrggbb> Set the background color to I<#rrggbb>. Default is white. =item C<--text> I<#rrggbb> Set the text color to I<#rrggbb>. Default is black. =item C<--variables> I Execute the file I with a C call before filling in I