Permalink
Browse files

All .js .css .png files are now placed in static/ sub-directory

instead of the website root directory
  • Loading branch information...
1 parent 7dfdd3e commit 9b1edb9f8441ea7e11434aa23584087d84e7a551 @jonallen committed Aug 21, 2009
View
@@ -99,7 +99,7 @@
}
}
-my $jsfile = catfile($Perldoc::Config::option{output_path},'indexPod.js');
+my $jsfile = catfile($Perldoc::Config::option{output_path},'static','indexPod.js');
my $template = Template->new(INCLUDE_PATH => TT_INCLUDE_PATH);
$template->process('indexpod-js.tt',{%Perldoc::Config::option, pods=>\@pods},$jsfile) || die $template->error;
@@ -119,7 +119,7 @@
}
}
-$jsfile = catfile($Perldoc::Config::option{output_path},'indexModules.js');
+$jsfile = catfile($Perldoc::Config::option{output_path},'static','indexModules.js');
$template->process('indexmodules-js.tt',{%Perldoc::Config::option, modules=>\@modules},$jsfile) || die $template->error;
@@ -136,7 +136,7 @@
push @functions,{name=>$function, description=>$description};
}
-$jsfile = catfile($Perldoc::Config::option{output_path},'indexFunctions.js');
+$jsfile = catfile($Perldoc::Config::option{output_path},'static','indexFunctions.js');
$template->process('indexfunctions-js.tt',{%Perldoc::Config::option, functions=>\@functions},$jsfile) || die $template->error;
@@ -159,7 +159,7 @@
}
}
-$jsfile = catfile($Perldoc::Config::option{output_path},'indexFAQs.js');
+$jsfile = catfile($Perldoc::Config::option{output_path},'static','indexFAQs.js');
$template->process('indexfaqs-js.tt',{%Perldoc::Config::option, faqs=>\@faqs},$jsfile) || die $template->error;
View
@@ -4,7 +4,8 @@
use warnings;
use File::Basename;
use File::Find;
-use File::Spec::Functions qw/catfile/;
+use File::Spec::Functions qw/catfile catdir/;
+use File::Path;
use FindBin qw/$Bin/;
use Getopt::Long;
use Shell qw/cp/;
@@ -101,8 +102,11 @@
#--Copy static files------------------------------------------------------
-cp('-r', "$Bin/static/*", $Perldoc::Config::option{output_path});
-cp('-r', "$Bin/javascript/*", $Perldoc::Config::option{output_path});
+my $static_path = catdir($Perldoc::Config::option{output_path},'static');
+mkpath($static_path) unless -d $static_path;
+
+cp('-r', "$Bin/static/*", $static_path);
+cp('-r', "$Bin/javascript/*", $static_path);
#--Process static html files with template--------------------------------
View
@@ -1,42 +0,0 @@
-#! /usr/bin/perl
-
-use strict;
-use warnings;
-use FindBin qw/$Bin/;
-use Pod::POM;
-use Pod::POM::View::Text;
-
-use lib "$Bin/lib";
-use Perldoc::Page;
-
-
-#--------------------------------------------------------------------------
-
-print "function loadFaqIndex() {\n";
-my $found = 0;
-foreach my $section (1..9) {
- my $pod = Perldoc::Page::pod("perlfaq$section");
- my $parser = Pod::POM->new();
- my $pom = $parser->parse_text($pod);
-
- foreach my $head1 ($pom->head1) {
- foreach my $head2 ($head1->head2) {
- my $title = $head2->title->present('Pod::POM::View::Text');
- $title =~ s/\n/ /g;
- $title =~ s/\\/\\\\/g;
- $title =~ s/"/\\"/g;
- print qq{ faqList[$found]=[$section,"$title"];\n};
- $found++;
- }
- }
-
-# foreach (Perldoc::Page::pod("perlfaq$section") =~ /=head2 (.*)$/mg) {
-# #s/\W/-/g;
-# s/\\/\\\\/g;
-# s/"/\\"/g;
-# s/C<(.*?)>/$1/g;
-# print qq{ faqList[$found]=[$section,"$_"];\n};
-# $found++;
-# }
-}
-print "}\n";
View
@@ -1,25 +0,0 @@
-#! /usr/bin/perl
-
-use strict;
-use warnings;
-use FindBin qw/$Bin/;
-use lib "$Bin/lib";
-use Perldoc::Page;
-use Perldoc::Section;
-
-
-#--------------------------------------------------------------------------
-
-print "function loadModuleIndex() {\n";
-
-foreach my $page (Perldoc::Section::pages('pragmas'), grep {/^[A-Z]/} (Perldoc::Page::list())) {
- if (my $title = Perldoc::Page::title($page)) {
- #s/\W/-/g;
- $title =~ s/\\/\\\\/g;
- $title =~ s/"/\\"/g;
- $title =~ s/C<(.*?)>/$1/g;
- $title =~ s/\n//sg;
- print qq{ moduleList["$page"]="$title";\n};
- }
-}
-print "}\n";
View
@@ -1,28 +0,0 @@
-#! /usr/bin/perl
-
-use strict;
-use warnings;
-use FindBin qw/$Bin/;
-use lib "$Bin/lib";
-use Perldoc::Page;
-use Perldoc::Section;
-
-
-#--------------------------------------------------------------------------
-
-print "function loadPodIndex() {\n";
-
-foreach my $section (grep {$_ ne 'pragmas'} (Perldoc::Section::list())) {
- my $section_name = Perldoc::Section::name($section);
- print qq{ sectionName["$section"]="$section_name";\n};
- foreach my $page (Perldoc::Section::pages($section)) {
- my $title = Perldoc::Page::title($page);
- #s/\W/-/g;
- $title =~ s/\\/\\\\/g;
- $title =~ s/"/\\"/g;
- $title =~ s/C<(.*?)>/$1/g;
- $title =~ s/\n//sg;
- print qq{ podList["$page"]=["$section","$title"];\n};
- }
-}
-print "}\n";
Oops, something went wrong.

0 comments on commit 9b1edb9

Please sign in to comment.