| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
|
|
2
|
|
|
|
|
|
|
require 5; |
|
3
|
|
|
|
|
|
|
package Pod::Simple::HTMLBatch; |
|
4
|
2
|
|
|
2
|
|
1770
|
use strict; |
|
|
2
|
|
|
|
|
4
|
|
|
|
2
|
|
|
|
|
87
|
|
|
5
|
2
|
|
|
|
|
209
|
use vars qw( $VERSION $HTML_RENDER_CLASS $HTML_EXTENSION |
|
6
|
|
|
|
|
|
|
$CSS $JAVASCRIPT $SLEEPY $SEARCH_CLASS @ISA |
|
7
|
2
|
|
|
2
|
|
11
|
); |
|
|
2
|
|
|
|
|
3
|
|
|
8
|
|
|
|
|
|
|
$VERSION = '3.42'; |
|
9
|
|
|
|
|
|
|
@ISA = (); # Yup, we're NOT a subclass of Pod::Simple::HTML! |
|
10
|
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
# TODO: nocontents stylesheets. Strike some of the color variations? |
|
12
|
|
|
|
|
|
|
|
|
13
|
2
|
|
|
2
|
|
566
|
use Pod::Simple::HTML (); |
|
|
2
|
|
|
|
|
7
|
|
|
|
2
|
|
|
|
|
71
|
|
|
14
|
2
|
|
|
2
|
|
39
|
BEGIN {*esc = \&Pod::Simple::HTML::esc } |
|
15
|
2
|
|
|
2
|
|
12
|
use File::Spec (); |
|
|
2
|
|
|
|
|
5
|
|
|
|
2
|
|
|
|
|
35
|
|
|
16
|
|
|
|
|
|
|
|
|
17
|
2
|
|
|
2
|
|
1226
|
use Pod::Simple::Search; |
|
|
2
|
|
|
|
|
6
|
|
|
|
2
|
|
|
|
|
162
|
|
|
18
|
|
|
|
|
|
|
$SEARCH_CLASS ||= 'Pod::Simple::Search'; |
|
19
|
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
BEGIN { |
|
21
|
2
|
50
|
|
2
|
|
14
|
if(defined &DEBUG) { } # no-op |
|
|
|
50
|
|
|
|
|
|
|
22
|
2
|
|
|
|
|
11363
|
elsif( defined &Pod::Simple::DEBUG ) { *DEBUG = \&Pod::Simple::DEBUG } |
|
23
|
0
|
|
|
|
|
0
|
else { *DEBUG = sub () {0}; } |
|
24
|
|
|
|
|
|
|
} |
|
25
|
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
$SLEEPY = 1 if !defined $SLEEPY and $^O =~ /mswin|mac/i; |
|
27
|
|
|
|
|
|
|
# flag to occasionally sleep for $SLEEPY - 1 seconds. |
|
28
|
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
$HTML_RENDER_CLASS ||= "Pod::Simple::HTML"; |
|
30
|
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
# |
|
32
|
|
|
|
|
|
|
# Methods beginning with "_" are particularly internal and possibly ugly. |
|
33
|
|
|
|
|
|
|
# |
|
34
|
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
Pod::Simple::_accessorize( __PACKAGE__, |
|
36
|
|
|
|
|
|
|
'verbose', # how verbose to be during batch conversion |
|
37
|
|
|
|
|
|
|
'html_render_class', # what class to use to render |
|
38
|
|
|
|
|
|
|
'search_class', # what to use to search for POD documents |
|
39
|
|
|
|
|
|
|
'contents_file', # If set, should be the name of a file (in current directory) |
|
40
|
|
|
|
|
|
|
# to write the list of all modules to |
|
41
|
|
|
|
|
|
|
'index', # will set $htmlpage->index(...) to this (true or false) |
|
42
|
|
|
|
|
|
|
'progress', # progress object |
|
43
|
|
|
|
|
|
|
'contents_page_start', 'contents_page_end', |
|
44
|
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
'css_flurry', '_css_wad', 'javascript_flurry', '_javascript_wad', |
|
46
|
|
|
|
|
|
|
'no_contents_links', # set to true to suppress automatic adding of << links. |
|
47
|
|
|
|
|
|
|
'_contents', |
|
48
|
|
|
|
|
|
|
); |
|
49
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
|
51
|
|
|
|
|
|
|
# Just so we can run from the command line more easily |
|
52
|
|
|
|
|
|
|
sub go { |
|
53
|
0
|
0
|
|
0
|
0
|
0
|
@ARGV == 2 or die sprintf( |
|
54
|
|
|
|
|
|
|
"Usage: perl -M%s -e %s:go indirs outdir\n (or use \"\@INC\" for indirs)\n", |
|
55
|
|
|
|
|
|
|
__PACKAGE__, __PACKAGE__, |
|
56
|
|
|
|
|
|
|
); |
|
57
|
|
|
|
|
|
|
|
|
58
|
0
|
0
|
0
|
|
|
0
|
if(defined($ARGV[1]) and length($ARGV[1])) { |
|
59
|
0
|
|
|
|
|
0
|
my $d = $ARGV[1]; |
|
60
|
0
|
0
|
|
|
|
0
|
-e $d or die "I see no output directory named \"$d\"\nAborting"; |
|
61
|
0
|
0
|
|
|
|
0
|
-d $d or die "But \"$d\" isn't a directory!\nAborting"; |
|
62
|
0
|
0
|
|
|
|
0
|
-w $d or die "Directory \"$d\" isn't writeable!\nAborting"; |
|
63
|
|
|
|
|
|
|
} |
|
64
|
|
|
|
|
|
|
|
|
65
|
0
|
|
|
|
|
0
|
__PACKAGE__->batch_convert(@ARGV); |
|
66
|
|
|
|
|
|
|
} |
|
67
|
|
|
|
|
|
|
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
|
68
|
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
sub new { |
|
71
|
1
|
|
33
|
1
|
1
|
4121
|
my $new = bless {}, ref($_[0]) || $_[0]; |
|
72
|
1
|
|
|
|
|
30
|
$new->html_render_class($HTML_RENDER_CLASS); |
|
73
|
1
|
|
|
|
|
13
|
$new->search_class($SEARCH_CLASS); |
|
74
|
1
|
|
|
|
|
13
|
$new->verbose(1 + DEBUG); |
|
75
|
1
|
|
|
|
|
21
|
$new->_contents([]); |
|
76
|
|
|
|
|
|
|
|
|
77
|
1
|
|
|
|
|
23
|
$new->index(1); |
|
78
|
|
|
|
|
|
|
|
|
79
|
1
|
|
|
|
|
13
|
$new-> _css_wad([]); $new->css_flurry(1); |
|
|
1
|
|
|
|
|
12
|
|
|
80
|
1
|
|
|
|
|
23
|
$new->_javascript_wad([]); $new->javascript_flurry(1); |
|
|
1
|
|
|
|
|
14
|
|
|
81
|
|
|
|
|
|
|
|
|
82
|
1
|
|
33
|
|
|
37
|
$new->contents_file( |
|
83
|
|
|
|
|
|
|
'index' . ($HTML_EXTENSION || $Pod::Simple::HTML::HTML_EXTENSION) |
|
84
|
|
|
|
|
|
|
); |
|
85
|
|
|
|
|
|
|
|
|
86
|
1
|
|
|
|
|
28
|
$new->contents_page_start( join "\n", grep $_, |
|
87
|
|
|
|
|
|
|
$Pod::Simple::HTML::Doctype_decl, |
|
88
|
|
|
|
|
|
|
"", |
|
89
|
|
|
|
|
|
|
"Perl Documentation", |
|
90
|
|
|
|
|
|
|
$Pod::Simple::HTML::Content_decl, |
|
91
|
|
|
|
|
|
|
"", |
|
92
|
|
|
|
|
|
|
"\n\nPerl Documentation\n" |
|
93
|
|
|
|
|
|
|
); # override if you need a different title |
|
94
|
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
$new->contents_page_end( sprintf( |
|
97
|
|
|
|
|
|
|
"\n\n\n\n\n", |
|
98
|
|
|
|
|
|
|
esc( |
|
99
|
|
|
|
|
|
|
ref($new), |
|
100
|
|
|
|
|
|
|
eval {$new->VERSION} || $VERSION, |
|
101
|
1
|
|
33
|
|
|
3
|
$], scalar(gmtime($ENV{SOURCE_DATE_EPOCH} || time)), |
|
|
|
|
33
|
|
|
|
|
|
102
|
|
|
|
|
|
|
))); |
|
103
|
|
|
|
|
|
|
|
|
104
|
1
|
|
|
|
|
5
|
return $new; |
|
105
|
|
|
|
|
|
|
} |
|
106
|
|
|
|
|
|
|
|
|
107
|
|
|
|
|
|
|
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
|
108
|
|
|
|
|
|
|
|
|
109
|
|
|
|
|
|
|
sub muse { |
|
110
|
10
|
|
|
10
|
0
|
26
|
my $self = shift; |
|
111
|
10
|
50
|
|
|
|
47
|
if($self->verbose) { |
|
112
|
0
|
|
|
|
|
0
|
print 'T+', int(time() - $self->{'_batch_start_time'}), "s: ", @_, "\n"; |
|
113
|
|
|
|
|
|
|
} |
|
114
|
10
|
|
|
|
|
26
|
return 1; |
|
115
|
|
|
|
|
|
|
} |
|
116
|
|
|
|
|
|
|
|
|
117
|
|
|
|
|
|
|
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
|
118
|
|
|
|
|
|
|
|
|
119
|
|
|
|
|
|
|
sub batch_convert { |
|
120
|
1
|
|
|
1
|
1
|
12
|
my($self, $dirs, $outdir) = @_; |
|
121
|
1
|
|
50
|
|
|
167
|
$self ||= __PACKAGE__; # tolerate being called as an optionless function |
|
122
|
1
|
50
|
|
|
|
17
|
$self = $self->new unless ref $self; # tolerate being used as a class method |
|
123
|
|
|
|
|
|
|
|
|
124
|
1
|
50
|
33
|
|
|
48
|
if(!defined($dirs) or $dirs eq '' or $dirs eq '@INC' ) { |
|
|
|
50
|
33
|
|
|
|
|
|
125
|
0
|
|
|
|
|
0
|
$dirs = ''; |
|
126
|
|
|
|
|
|
|
} elsif(ref $dirs) { |
|
127
|
|
|
|
|
|
|
# OK, it's an explicit set of dirs to scan, specified as an arrayref. |
|
128
|
|
|
|
|
|
|
} else { |
|
129
|
|
|
|
|
|
|
# OK, it's an explicit set of dirs to scan, specified as a |
|
130
|
|
|
|
|
|
|
# string like "/thing:/also:/whatever/perl" (":"-delim, as usual) |
|
131
|
|
|
|
|
|
|
# or, under MSWin, like "c:/thing;d:/also;c:/whatever/perl" (";"-delim!) |
|
132
|
0
|
|
|
|
|
0
|
require Config; |
|
133
|
0
|
|
0
|
|
|
0
|
my $ps = quotemeta( $Config::Config{'path_sep'} || ":" ); |
|
134
|
0
|
|
|
|
|
0
|
$dirs = [ grep length($_), split qr/$ps/, $dirs ]; |
|
135
|
|
|
|
|
|
|
} |
|
136
|
|
|
|
|
|
|
|
|
137
|
1
|
50
|
33
|
|
|
24
|
$outdir = $self->filespecsys->curdir |
|
138
|
|
|
|
|
|
|
unless defined $outdir and length $outdir; |
|
139
|
|
|
|
|
|
|
|
|
140
|
1
|
|
|
|
|
14
|
$self->_batch_convert_main($dirs, $outdir); |
|
141
|
|
|
|
|
|
|
} |
|
142
|
|
|
|
|
|
|
|
|
143
|
|
|
|
|
|
|
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
|
144
|
|
|
|
|
|
|
|
|
145
|
|
|
|
|
|
|
sub _batch_convert_main { |
|
146
|
1
|
|
|
1
|
|
4
|
my($self, $dirs, $outdir) = @_; |
|
147
|
|
|
|
|
|
|
# $dirs is either false, or an arrayref. |
|
148
|
|
|
|
|
|
|
# $outdir is a pathspec. |
|
149
|
|
|
|
|
|
|
|
|
150
|
1
|
|
33
|
|
|
28
|
$self->{'_batch_start_time'} ||= time(); |
|
151
|
|
|
|
|
|
|
|
|
152
|
1
|
|
|
|
|
44
|
$self->muse( "= ", scalar(localtime) ); |
|
153
|
1
|
|
|
|
|
6
|
$self->muse( "Starting batch conversion to \"$outdir\"" ); |
|
154
|
|
|
|
|
|
|
|
|
155
|
1
|
|
|
|
|
2
|
my $progress = $self->progress; |
|
156
|
1
|
50
|
33
|
|
|
16
|
if(!$progress and $self->verbose > 0 and $self->verbose() <= 5) { |
|
|
|
|
33
|
|
|
|
|
|
157
|
0
|
|
|
|
|
0
|
require Pod::Simple::Progress; |
|
158
|
0
|
0
|
|
|
|
0
|
$progress = Pod::Simple::Progress->new( |
|
|
|
0
|
|
|
|
|
|
|
159
|
|
|
|
|
|
|
($self->verbose < 2) ? () # Default omission-delay |
|
160
|
|
|
|
|
|
|
: ($self->verbose == 2) ? 1 # Reduce the omission-delay |
|
161
|
|
|
|
|
|
|
: 0 # Eliminate the omission-delay |
|
162
|
|
|
|
|
|
|
); |
|
163
|
0
|
|
|
|
|
0
|
$self->progress($progress); |
|
164
|
|
|
|
|
|
|
} |
|
165
|
|
|
|
|
|
|
|
|
166
|
1
|
50
|
|
|
|
4
|
if($dirs) { |
|
167
|
1
|
|
|
|
|
11
|
$self->muse(scalar(@$dirs), " dirs to scan: @$dirs"); |
|
168
|
|
|
|
|
|
|
} else { |
|
169
|
0
|
|
|
|
|
0
|
$self->muse("Scanning \@INC. This could take a minute or two."); |
|
170
|
|
|
|
|
|
|
} |
|
171
|
1
|
50
|
|
|
|
11
|
my $mod2path = $self->find_all_pods($dirs ? $dirs : ()); |
|
172
|
1
|
|
|
|
|
6
|
$self->muse("Done scanning."); |
|
173
|
|
|
|
|
|
|
|
|
174
|
1
|
|
|
|
|
3
|
my $total = keys %$mod2path; |
|
175
|
1
|
50
|
|
|
|
3
|
unless($total) { |
|
176
|
0
|
|
|
|
|
0
|
$self->muse("No pod found. Aborting batch conversion.\n"); |
|
177
|
0
|
|
|
|
|
0
|
return $self; |
|
178
|
|
|
|
|
|
|
} |
|
179
|
|
|
|
|
|
|
|
|
180
|
1
|
50
|
|
|
|
2
|
$progress and $progress->goal($total); |
|
181
|
1
|
50
|
|
|
|
5
|
$self->muse("Now converting pod files to HTML.", |
|
182
|
|
|
|
|
|
|
($total > 25) ? " This will take a while more." : () |
|
183
|
|
|
|
|
|
|
); |
|
184
|
|
|
|
|
|
|
|
|
185
|
1
|
|
|
|
|
4
|
$self->_spray_css( $outdir ); |
|
186
|
1
|
|
|
|
|
7
|
$self->_spray_javascript( $outdir ); |
|
187
|
|
|
|
|
|
|
|
|
188
|
1
|
|
|
|
|
5
|
$self->_do_all_batch_conversions($mod2path, $outdir); |
|
189
|
|
|
|
|
|
|
|
|
190
|
|
|
|
|
|
|
$progress and $progress->done(sprintf ( |
|
191
|
1
|
50
|
|
|
|
5
|
"Done converting %d files.", $self->{"__batch_conv_page_count"} |
|
192
|
|
|
|
|
|
|
)); |
|
193
|
1
|
|
|
|
|
7
|
return $self->_batch_convert_finish($outdir); |
|
194
|
0
|
|
|
|
|
0
|
return $self; |
|
195
|
|
|
|
|
|
|
} |
|
196
|
|
|
|
|
|
|
|
|
197
|
|
|
|
|
|
|
|
|
198
|
|
|
|
|
|
|
sub _do_all_batch_conversions { |
|
199
|
1
|
|
|
1
|
|
4
|
my($self, $mod2path, $outdir) = @_; |
|
200
|
1
|
|
|
|
|
3
|
$self->{"__batch_conv_page_count"} = 0; |
|
201
|
|
|
|
|
|
|
|
|
202
|
1
|
|
|
|
|
6
|
foreach my $module (sort {lc($a) cmp lc($b)} keys %$mod2path) { |
|
|
22
|
|
|
|
|
43
|
|
|
203
|
10
|
|
|
|
|
36
|
$self->_do_one_batch_conversion($module, $mod2path, $outdir); |
|
204
|
10
|
50
|
|
|
|
33
|
sleep($SLEEPY - 1) if $SLEEPY; |
|
205
|
|
|
|
|
|
|
} |
|
206
|
|
|
|
|
|
|
|
|
207
|
1
|
|
|
|
|
4
|
return; |
|
208
|
|
|
|
|
|
|
} |
|
209
|
|
|
|
|
|
|
|
|
210
|
|
|
|
|
|
|
sub _batch_convert_finish { |
|
211
|
1
|
|
|
1
|
|
5
|
my($self, $outdir) = @_; |
|
212
|
1
|
|
|
|
|
5
|
$self->write_contents_file($outdir); |
|
213
|
1
|
|
|
|
|
8
|
$self->muse("Done with batch conversion. $$self{'__batch_conv_page_count'} files done."); |
|
214
|
1
|
|
|
|
|
58
|
$self->muse( "= ", scalar(localtime) ); |
|
215
|
1
|
50
|
|
|
|
4
|
$self->progress and $self->progress->done("All done!"); |
|
216
|
1
|
|
|
|
|
12
|
return; |
|
217
|
|
|
|
|
|
|
} |
|
218
|
|
|
|
|
|
|
|
|
219
|
|
|
|
|
|
|
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
|
220
|
|
|
|
|
|
|
|
|
221
|
|
|
|
|
|
|
sub _do_one_batch_conversion { |
|
222
|
10
|
|
|
10
|
|
28
|
my($self, $module, $mod2path, $outdir, $outfile) = @_; |
|
223
|
|
|
|
|
|
|
|
|
224
|
10
|
|
|
|
|
19
|
my $retval; |
|
225
|
10
|
|
|
|
|
18
|
my $total = scalar keys %$mod2path; |
|
226
|
10
|
|
|
|
|
22
|
my $infile = $mod2path->{$module}; |
|
227
|
10
|
|
|
|
|
91
|
my @namelets = grep m/\S/, split "::", $module; |
|
228
|
|
|
|
|
|
|
# this can stick around in the contents LoL |
|
229
|
10
|
|
|
|
|
23
|
my $depth = scalar @namelets; |
|
230
|
10
|
50
|
|
|
|
24
|
die "Contentless thingie?! $module $infile" unless @namelets; #sanity |
|
231
|
|
|
|
|
|
|
|
|
232
|
10
|
|
33
|
|
|
31
|
$outfile ||= do { |
|
233
|
10
|
|
|
|
|
17
|
my @n = @namelets; |
|
234
|
10
|
|
33
|
|
|
49
|
$n[-1] .= $HTML_EXTENSION || $Pod::Simple::HTML::HTML_EXTENSION; |
|
235
|
10
|
|
|
|
|
29
|
$self->filespecsys->catfile( $outdir, @n ); |
|
236
|
|
|
|
|
|
|
}; |
|
237
|
|
|
|
|
|
|
|
|
238
|
10
|
|
|
|
|
40
|
my $progress = $self->progress; |
|
239
|
|
|
|
|
|
|
|
|
240
|
10
|
|
|
|
|
35
|
my $page = $self->html_render_class->new; |
|
241
|
10
|
|
|
|
|
18
|
if(DEBUG > 5) { |
|
242
|
|
|
|
|
|
|
$self->muse($self->{"__batch_conv_page_count"} + 1, "/$total: ", |
|
243
|
|
|
|
|
|
|
ref($page), " render ($depth) $module => $outfile"); |
|
244
|
0
|
|
|
|
|
0
|
} elsif(DEBUG > 2) { |
|
245
|
|
|
|
|
|
|
$self->muse($self->{"__batch_conv_page_count"} + 1, "/$total: $module => $outfile") |
|
246
|
|
|
|
|
|
|
} |
|
247
|
|
|
|
|
|
|
|
|
248
|
|
|
|
|
|
|
# Give each class a chance to init the converter: |
|
249
|
10
|
50
|
|
|
|
71
|
$page->batch_mode_page_object_init($self, $module, $infile, $outfile, $depth) |
|
250
|
|
|
|
|
|
|
if $page->can('batch_mode_page_object_init'); |
|
251
|
|
|
|
|
|
|
# Init for the index (TOC), too. |
|
252
|
10
|
50
|
|
|
|
61
|
$self->batch_mode_page_object_init($page, $module, $infile, $outfile, $depth) |
|
253
|
|
|
|
|
|
|
if $self->can('batch_mode_page_object_init'); |
|
254
|
|
|
|
|
|
|
|
|
255
|
|
|
|
|
|
|
# Now get busy... |
|
256
|
10
|
|
|
|
|
32
|
$self->makepath($outdir => \@namelets); |
|
257
|
|
|
|
|
|
|
|
|
258
|
10
|
50
|
|
|
|
23
|
$progress and $progress->reach($self->{"__batch_conv_page_count"}, "Rendering $module"); |
|
259
|
|
|
|
|
|
|
|
|
260
|
10
|
50
|
|
|
|
54
|
if( $retval = $page->parse_from_file($infile, $outfile) ) { |
|
261
|
10
|
|
|
|
|
21
|
++ $self->{"__batch_conv_page_count"} ; |
|
262
|
10
|
|
|
|
|
32
|
$self->note_for_contents_file( \@namelets, $infile, $outfile ); |
|
263
|
|
|
|
|
|
|
} else { |
|
264
|
0
|
|
|
|
|
0
|
$self->muse("Odd, parse_from_file(\"$infile\", \"$outfile\") returned false."); |
|
265
|
|
|
|
|
|
|
} |
|
266
|
|
|
|
|
|
|
|
|
267
|
10
|
50
|
|
|
|
48
|
$page->batch_mode_page_object_kill($self, $module, $infile, $outfile, $depth) |
|
268
|
|
|
|
|
|
|
if $page->can('batch_mode_page_object_kill'); |
|
269
|
|
|
|
|
|
|
# The following isn't a typo. Note that it switches $self and $page. |
|
270
|
10
|
50
|
|
|
|
32
|
$self->batch_mode_page_object_kill($page, $module, $infile, $outfile, $depth) |
|
271
|
|
|
|
|
|
|
if $self->can('batch_mode_page_object_kill'); |
|
272
|
|
|
|
|
|
|
|
|
273
|
10
|
|
|
|
|
13
|
DEBUG > 4 and printf STDERR "%s %sb < $infile %s %sb\n", |
|
274
|
|
|
|
|
|
|
$outfile, -s $outfile, $infile, -s $infile |
|
275
|
|
|
|
|
|
|
; |
|
276
|
|
|
|
|
|
|
|
|
277
|
10
|
|
|
|
|
701
|
undef($page); |
|
278
|
10
|
|
|
|
|
51
|
return $retval; |
|
279
|
|
|
|
|
|
|
} |
|
280
|
|
|
|
|
|
|
|
|
281
|
|
|
|
|
|
|
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
|
282
|
28
|
50
|
|
28
|
0
|
531
|
sub filespecsys { $_[0]{'_filespecsys'} || 'File::Spec' } |
|
283
|
|
|
|
|
|
|
|
|
284
|
|
|
|
|
|
|
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
|
285
|
|
|
|
|
|
|
|
|
286
|
|
|
|
|
|
|
sub note_for_contents_file { |
|
287
|
10
|
|
|
10
|
0
|
25
|
my($self, $namelets, $infile, $outfile) = @_; |
|
288
|
|
|
|
|
|
|
|
|
289
|
|
|
|
|
|
|
# I think the infile and outfile parts are never used. -- SMB |
|
290
|
|
|
|
|
|
|
# But it's handy to have them around for debugging. |
|
291
|
|
|
|
|
|
|
|
|
292
|
10
|
50
|
|
|
|
36
|
if( $self->contents_file ) { |
|
293
|
10
|
|
|
|
|
24
|
my $c = $self->_contents(); |
|
294
|
10
|
|
|
|
|
41
|
push @$c, |
|
295
|
|
|
|
|
|
|
[ join("::", @$namelets), $infile, $outfile, $namelets ] |
|
296
|
|
|
|
|
|
|
# 0 1 2 3 |
|
297
|
|
|
|
|
|
|
; |
|
298
|
10
|
|
|
|
|
17
|
DEBUG > 3 and print STDERR "Noting @$c[-1]\n"; |
|
299
|
|
|
|
|
|
|
} |
|
300
|
10
|
|
|
|
|
20
|
return; |
|
301
|
|
|
|
|
|
|
} |
|
302
|
|
|
|
|
|
|
|
|
303
|
|
|
|
|
|
|
#_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_- |
|
304
|
|
|
|
|
|
|
|
|
305
|
|
|
|
|
|
|
sub write_contents_file { |
|
306
|
1
|
|
|
1
|
0
|
2
|
my($self, $outdir) = @_; |
|
307
|
1
|
|
50
|
|
|
7
|
my $outfile = $self->_contents_filespec($outdir) || return; |
|
308
|
|
|
|
|
|
|
|
|
309
|
1
|
|
|
|
|
6
|
$self->muse("Preparing list of modules for ToC"); |
|
310
|
|
|
|
|
|
|
|
|
311
|
1
|
|
|
|
|
4
|
my($toplevel, # maps toplevelbit => [all submodules] |
|
312
|
|
|
|
|
|
|
$toplevel_form_freq, # ends up being 'foo' => 'Foo' |
|
313
|
|
|
|
|
|
|
) = $self->_prep_contents_breakdown; |
|
314
|
|
|
|
|
|
|
|
|
315
|
1
|
|
|
|
|
3
|
my $Contents = eval { $self->_wopen($outfile) }; |
|
|
1
|
|
|
|
|
5
|
|
|
316
|
1
|
50
|
|
|
|
8
|
if( $Contents ) { |
|
317
|
1
|
|
|
|
|
7
|
$self->muse( "Writing contents file $outfile" ); |
|
318
|
|
|
|
|
|
|
} else { |
|
319
|
0
|
|
|
|
|
0
|
warn "Couldn't write-open contents file $outfile: $!\nAbort writing to $outfile at all"; |
|
320
|
0
|
|
|
|
|
0
|
return; |
|
321
|
|
|
|
|
|
|
} |
|
322
|
|
|
|
|
|
|
|
|
323
|
1
|
|
|
|
|
7
|
$self->_write_contents_start( $Contents, $outfile, ); |
|
324
|
1
|
|
|
|
|
8
|
$self->_write_contents_middle( $Contents, $outfile, $toplevel, $toplevel_form_freq ); |
|
325
|
1
|
|
|
|
|
4
|
$self->_write_contents_end( $Contents, $outfile, ); |
|
326
|
1
|
|
|
|
|
9
|
return $outfile; |
|
327
|
|
|
|
|
|
|
} |
|
328
|
|
|
|
|
|
|
|
|
329
|
|
|
|
|
|
|
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
|
330
|
|
|
|
|
|
|
|
|
331
|
|
|
|
|
|
|
sub _write_contents_start { |
|
332
|
1
|
|
|
1
|
|
4
|
my($self, $Contents, $outfile) = @_; |
|
333
|
1
|
|
50
|
|
|
4
|
my $starter = $self->contents_page_start || ''; |
|
334
|
|
|
|
|
|
|
|
|
335
|
|
|
|
|
|
|
{ |
|
336
|
1
|
|
|
|
|
3
|
my $css_wad = $self->_css_wad_to_markup(1); |
|
|
1
|
|
|
|
|
6
|
|
|
337
|
1
|
50
|
|
|
|
4
|
if( $css_wad ) { |
|
338
|
1
|
|
|
|
|
14
|
$starter =~ s{()}{\n$css_wad\n$1}i; # otherwise nevermind |
|
339
|
|
|
|
|
|
|
} |
|
340
|
|
|
|
|
|
|
|
|
341
|
1
|
|
|
|
|
5
|
my $javascript_wad = $self->_javascript_wad_to_markup(1); |
|
342
|
1
|
50
|
|
|
|
4
|
if( $javascript_wad ) { |
|
343
|
1
|
|
|
|
|
14
|
$starter =~ s{()}{\n$javascript_wad\n$1}i; # otherwise nevermind |
|
344
|
|
|
|
|
|
|
} |
|
345
|
|
|
|
|
|
|
} |
|
346
|
|
|
|
|
|
|
|
|
347
|
1
|
50
|
|
|
|
25
|
unless(print $Contents $starter, "\n" ) { |
|
348
|
0
|
|
|
|
|
0
|
warn "Couldn't print to $outfile: $!\nAbort writing to $outfile at all"; |
|
349
|
0
|
|
|
|
|
0
|
close($Contents); |
|
350
|
0
|
|
|
|
|
0
|
return 0; |
|
351
|
|
|
|
|
|
|
} |
|
352
|
1
|
|
|
|
|
5
|
return 1; |
|
353
|
|
|
|
|
|
|
} |
|
354
|
|
|
|
|
|
|
|
|
355
|
|
|
|
|
|
|
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
|
356
|
|
|
|
|
|
|
|
|
357
|
|
|
|
|
|
|
sub _write_contents_middle { |
|
358
|
1
|
|
|
1
|
|
5
|
my($self, $Contents, $outfile, $toplevel2submodules, $toplevel_form_freq) = @_; |
|
359
|
|
|
|
|
|
|
|
|
360
|
1
|
|
|
|
|
13
|
foreach my $t (sort keys %$toplevel2submodules) { |
|
361
|
5
|
|
|
|
|
14
|
my @downlines = sort {$a->[-1] cmp $b->[-1]} |
|
362
|
6
|
|
|
|
|
13
|
@{ $toplevel2submodules->{$t} }; |
|
|
6
|
|
|
|
|
20
|
|
|
363
|
|
|
|
|
|
|
|
|
364
|
|
|
|
|
|
|
printf $Contents qq[%s\n\n], |
|
365
|
6
|
|
|
|
|
19
|
esc( $t, $toplevel_form_freq->{$t} ) |
|
366
|
|
|
|
|
|
|
; |
|
367
|
|
|
|
|
|
|
|
|
368
|
6
|
|
|
|
|
13
|
my($path, $name); |
|
369
|
6
|
|
|
|
|
14
|
foreach my $e (@downlines) { |
|
370
|
10
|
|
|
|
|
18
|
$name = $e->[0]; |
|
371
|
10
|
|
33
|
|
|
13
|
$path = join( "/", '.', esc( @{$e->[3]} ) ) |
|
|
10
|
|
|
|
|
23
|
|
|
372
|
|
|
|
|
|
|
. ($HTML_EXTENSION || $Pod::Simple::HTML::HTML_EXTENSION); |
|
373
|
10
|
|
|
|
|
30
|
print $Contents qq{ }, esc($name), " \n"; |
|
374
|
|
|
|
|
|
|
} |
|
375
|
6
|
|
|
|
|
13
|
print $Contents "\n\n"; |
|
376
|
|
|
|
|
|
|
} |
|
377
|
1
|
|
|
|
|
4
|
return 1; |
|
378
|
|
|
|
|
|
|
} |
|
379
|
|
|
|
|
|
|
|
|
380
|
|
|
|
|
|
|
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
|
381
|
|
|
|
|
|
|
|
|
382
|
|
|
|
|
|
|
sub _write_contents_end { |
|
383
|
1
|
|
|
1
|
|
4
|
my($self, $Contents, $outfile) = @_; |
|
384
|
1
|
50
|
50
|
|
|
6
|
unless( |
|
385
|
|
|
|
|
|
|
print $Contents "\n", |
|
386
|
|
|
|
|
|
|
$self->contents_page_end || '', |
|
387
|
|
|
|
|
|
|
) { |
|
388
|
0
|
|
|
|
|
0
|
warn "Couldn't write to $outfile: $!"; |
|
389
|
|
|
|
|
|
|
} |
|
390
|
1
|
50
|
|
|
|
37
|
close($Contents) or warn "Couldn't close $outfile: $!"; |
|
391
|
1
|
|
|
|
|
5
|
return 1; |
|
392
|
|
|
|
|
|
|
} |
|
393
|
|
|
|
|
|
|
|
|
394
|
|
|
|
|
|
|
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
|
395
|
|
|
|
|
|
|
|
|
396
|
|
|
|
|
|
|
sub _prep_contents_breakdown { |
|
397
|
1
|
|
|
1
|
|
3
|
my($self) = @_; |
|
398
|
1
|
|
|
|
|
4
|
my $contents = $self->_contents; |
|
399
|
1
|
|
|
|
|
2
|
my %toplevel; # maps lctoplevelbit => [all submodules] |
|
400
|
|
|
|
|
|
|
my %toplevel_form_freq; # ends up being 'foo' => 'Foo' |
|
401
|
|
|
|
|
|
|
# (mapping anycase forms to most freq form) |
|
402
|
|
|
|
|
|
|
|
|
403
|
1
|
|
|
|
|
10
|
foreach my $entry (@$contents) { |
|
404
|
10
|
100
|
|
|
|
43
|
my $toplevel = |
|
405
|
|
|
|
|
|
|
$entry->[0] =~ m/^perl\w*$/ ? 'perl_core_docs' |
|
406
|
|
|
|
|
|
|
# group all the perlwhatever docs together |
|
407
|
|
|
|
|
|
|
: $entry->[3][0] # normal case |
|
408
|
|
|
|
|
|
|
; |
|
409
|
10
|
|
|
|
|
26
|
++$toplevel_form_freq{ lc $toplevel }{ $toplevel }; |
|
410
|
10
|
|
|
|
|
13
|
push @{ $toplevel{ lc $toplevel } }, $entry; |
|
|
10
|
|
|
|
|
18
|
|
|
411
|
10
|
|
|
|
|
27
|
push @$entry, lc($entry->[0]); # add a sort-order key to the end |
|
412
|
|
|
|
|
|
|
} |
|
413
|
|
|
|
|
|
|
|
|
414
|
1
|
|
|
|
|
7
|
foreach my $toplevel (sort keys %toplevel) { |
|
415
|
6
|
|
|
|
|
11
|
my $fgroup = $toplevel_form_freq{$toplevel}; |
|
416
|
|
|
|
|
|
|
$toplevel_form_freq{$toplevel} = |
|
417
|
|
|
|
|
|
|
( |
|
418
|
6
|
0
|
|
|
|
17
|
sort { $fgroup->{$b} <=> $fgroup->{$a} or $a cmp $b } |
|
|
0
|
|
|
|
|
0
|
|
|
419
|
|
|
|
|
|
|
keys %$fgroup |
|
420
|
|
|
|
|
|
|
# This hash is extremely unlikely to have more than 4 members, so this |
|
421
|
|
|
|
|
|
|
# sort isn't so very wasteful |
|
422
|
|
|
|
|
|
|
)[0]; |
|
423
|
|
|
|
|
|
|
} |
|
424
|
|
|
|
|
|
|
|
|
425
|
1
|
50
|
|
|
|
8
|
return(\%toplevel, \%toplevel_form_freq) if wantarray; |
|
426
|
0
|
|
|
|
|
0
|
return \%toplevel; |
|
427
|
|
|
|
|
|
|
} |
|
428
|
|
|
|
|
|
|
|
|
429
|
|
|
|
|
|
|
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
|
430
|
|
|
|
|
|
|
|
|
431
|
|
|
|
|
|
|
sub _contents_filespec { |
|
432
|
1
|
|
|
1
|
|
3
|
my($self, $outdir) = @_; |
|
433
|
1
|
|
|
|
|
4
|
my $outfile = $self->contents_file; |
|
434
|
1
|
50
|
|
|
|
3
|
return unless $outfile; |
|
435
|
1
|
|
|
|
|
6
|
return $self->filespecsys->catfile( $outdir, $outfile ); |
|
436
|
|
|
|
|
|
|
} |
|
437
|
|
|
|
|
|
|
|
|
438
|
|
|
|
|
|
|
#_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_- |
|
439
|
|
|
|
|
|
|
|
|
440
|
|
|
|
|
|
|
sub makepath { |
|
441
|
10
|
|
|
10
|
0
|
18
|
my($self, $outdir, $namelets) = @_; |
|
442
|
10
|
100
|
|
|
|
24
|
return unless @$namelets > 1; |
|
443
|
5
|
|
|
|
|
24
|
for my $i (0 .. ($#$namelets - 1)) { |
|
444
|
5
|
|
|
|
|
16
|
my $dir = $self->filespecsys->catdir( $outdir, @$namelets[0 .. $i] ); |
|
445
|
5
|
100
|
|
|
|
137
|
if(-e $dir) { |
|
446
|
2
|
50
|
|
|
|
32
|
die "$dir exists but not as a directory!?" unless -d $dir; |
|
447
|
2
|
|
|
|
|
7
|
next; |
|
448
|
|
|
|
|
|
|
} |
|
449
|
3
|
|
|
|
|
8
|
DEBUG > 3 and print STDERR " Making $dir\n"; |
|
450
|
3
|
50
|
|
|
|
202
|
mkdir $dir, 0777 |
|
451
|
|
|
|
|
|
|
or die "Can't mkdir $dir: $!\nAborting" |
|
452
|
|
|
|
|
|
|
; |
|
453
|
|
|
|
|
|
|
} |
|
454
|
5
|
|
|
|
|
18
|
return; |
|
455
|
|
|
|
|
|
|
} |
|
456
|
|
|
|
|
|
|
|
|
457
|
|
|
|
|
|
|
#_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_- |
|
458
|
|
|
|
|
|
|
|
|
459
|
|
|
|
|
|
|
sub batch_mode_page_object_init { |
|
460
|
10
|
|
|
10
|
0
|
19
|
my $self = shift; |
|
461
|
10
|
|
|
|
|
23
|
my($page, $module, $infile, $outfile, $depth) = @_; |
|
462
|
|
|
|
|
|
|
|
|
463
|
|
|
|
|
|
|
# TODO: any further options to percolate onto this new object here? |
|
464
|
|
|
|
|
|
|
|
|
465
|
10
|
|
|
|
|
26
|
$page->default_title($module); |
|
466
|
10
|
|
|
|
|
29
|
$page->index( $self->index ); |
|
467
|
|
|
|
|
|
|
|
|
468
|
10
|
|
|
|
|
34
|
$page->html_css( $self-> _css_wad_to_markup($depth) ); |
|
469
|
10
|
|
|
|
|
26
|
$page->html_javascript( $self->_javascript_wad_to_markup($depth) ); |
|
470
|
|
|
|
|
|
|
|
|
471
|
10
|
|
|
|
|
33
|
$self->add_header_backlink($page, $module, $infile, $outfile, $depth); |
|
472
|
10
|
|
|
|
|
28
|
$self->add_footer_backlink($page, $module, $infile, $outfile, $depth); |
|
473
|
|
|
|
|
|
|
|
|
474
|
|
|
|
|
|
|
|
|
475
|
10
|
|
|
|
|
17
|
return $self; |
|
476
|
|
|
|
|
|
|
} |
|
477
|
|
|
|
|
|
|
|
|
478
|
|
|
|
|
|
|
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
|
479
|
|
|
|
|
|
|
|
|
480
|
|
|
|
|
|
|
sub add_header_backlink { |
|
481
|
10
|
|
|
10
|
0
|
19
|
my $self = shift; |
|
482
|
10
|
50
|
|
|
|
36
|
return if $self->no_contents_links; |
|
483
|
10
|
|
|
|
|
23
|
my($page, $module, $infile, $outfile, $depth) = @_; |
|
484
|
10
|
50
|
50
|
|
|
29
|
$page->html_header_after_title( join '', |
|
485
|
|
|
|
|
|
|
$page->html_header_after_title || '', |
|
486
|
|
|
|
|
|
|
|
|
487
|
|
|
|
|
|
|
qq[
488
|
|
|
|
|
|
|
$self->url_up_to_contents($depth), |
|
489
|
|
|
|
|
|
|
qq[" accesskey="1" title="All Documents"><<\n], |
|
490
|
|
|
|
|
|
|
) |
|
491
|
|
|
|
|
|
|
if $self->contents_file |
|
492
|
|
|
|
|
|
|
; |
|
493
|
10
|
|
|
|
|
26
|
return; |
|
494
|
|
|
|
|
|
|
} |
|
495
|
|
|
|
|
|
|
|
|
496
|
|
|
|
|
|
|
sub add_footer_backlink { |
|
497
|
10
|
|
|
10
|
0
|
14
|
my $self = shift; |
|
498
|
10
|
50
|
|
|
|
21
|
return if $self->no_contents_links; |
|
499
|
10
|
|
|
|
|
21
|
my($page, $module, $infile, $outfile, $depth) = @_; |
|
500
|
10
|
50
|
50
|
|
|
22
|
$page->html_footer( join '', |
|
501
|
|
|
|
|
|
|
qq[
502
|
|
|
|
|
|
|
$self->url_up_to_contents($depth), |
|
503
|
|
|
|
|
|
|
qq[" title="All Documents"><<\n], |
|
504
|
|
|
|
|
|
|
|
|
505
|
|
|
|
|
|
|
$page->html_footer || '', |
|
506
|
|
|
|
|
|
|
) |
|
507
|
|
|
|
|
|
|
if $self->contents_file |
|
508
|
|
|
|
|
|
|
; |
|
509
|
10
|
|
|
|
|
19
|
return; |
|
510
|
|
|
|
|
|
|
} |
|
511
|
|
|
|
|
|
|
|
|
512
|
|
|
|
|
|
|
sub url_up_to_contents { |
|
513
|
20
|
|
|
20
|
0
|
34
|
my($self, $depth) = @_; |
|
514
|
20
|
|
|
|
|
26
|
--$depth; |
|
515
|
20
|
|
|
|
|
44
|
return join '/', ('..') x $depth, esc($self->contents_file); |
|
516
|
|
|
|
|
|
|
} |
|
517
|
|
|
|
|
|
|
|
|
518
|
|
|
|
|
|
|
#_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_- |
|
519
|
|
|
|
|
|
|
|
|
520
|
|
|
|
|
|
|
sub find_all_pods { |
|
521
|
1
|
|
|
1
|
0
|
3
|
my($self, $dirs) = @_; |
|
522
|
|
|
|
|
|
|
# You can override find_all_pods in a subclass if you want to |
|
523
|
|
|
|
|
|
|
# do extra filtering or whatnot. But for the moment, we just |
|
524
|
|
|
|
|
|
|
# pass to modnames2paths: |
|
525
|
1
|
|
|
|
|
8
|
return $self->modnames2paths($dirs); |
|
526
|
|
|
|
|
|
|
} |
|
527
|
|
|
|
|
|
|
|
|
528
|
|
|
|
|
|
|
#_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_- |
|
529
|
|
|
|
|
|
|
|
|
530
|
|
|
|
|
|
|
sub modnames2paths { # return a hashref mapping modulenames => paths |
|
531
|
1
|
|
|
1
|
0
|
4
|
my($self, $dirs) = @_; |
|
532
|
|
|
|
|
|
|
|
|
533
|
1
|
|
|
|
|
2
|
my $m2p; |
|
534
|
|
|
|
|
|
|
{ |
|
535
|
1
|
|
|
|
|
2
|
my $search = $self->search_class->new; |
|
|
1
|
|
|
|
|
3
|
|
|
536
|
1
|
|
|
|
|
3
|
DEBUG and print STDERR "Searching via $search\n"; |
|
537
|
1
|
|
|
|
|
2
|
$search->verbose(1) if DEBUG > 10; |
|
538
|
1
|
50
|
|
|
|
3
|
$search->progress( $self->progress->copy->goal(0) ) if $self->progress; |
|
539
|
1
|
|
|
|
|
5
|
$search->shadows(0); # don't bother noting shadowed files |
|
540
|
1
|
50
|
|
|
|
11
|
$search->inc( $dirs ? 0 : 1 ); |
|
541
|
1
|
50
|
|
|
|
5
|
$search->survey( $dirs ? @$dirs : () ); |
|
542
|
1
|
|
|
|
|
10
|
$m2p = $search->name2path; |
|
543
|
1
|
50
|
|
|
|
36
|
die "What, no name2path?!" unless $m2p; |
|
544
|
|
|
|
|
|
|
} |
|
545
|
|
|
|
|
|
|
|
|
546
|
1
|
50
|
|
|
|
10
|
$self->muse("That's odd... no modules found!") unless keys %$m2p; |
|
547
|
1
|
|
|
|
|
3
|
if( DEBUG > 4 ) { |
|
548
|
|
|
|
|
|
|
print STDERR "Modules found (name => path):\n"; |
|
549
|
|
|
|
|
|
|
foreach my $m (sort {lc($a) cmp lc($b)} keys %$m2p) { |
|
550
|
|
|
|
|
|
|
print STDERR " $m $$m2p{$m}\n"; |
|
551
|
|
|
|
|
|
|
} |
|
552
|
|
|
|
|
|
|
print STDERR "(total ", scalar(keys %$m2p), ")\n\n"; |
|
553
|
0
|
|
|
|
|
0
|
} elsif( DEBUG ) { |
|
554
|
|
|
|
|
|
|
print STDERR "Found ", scalar(keys %$m2p), " modules.\n"; |
|
555
|
|
|
|
|
|
|
} |
|
556
|
1
|
|
|
|
|
16
|
$self->muse( "Found ", scalar(keys %$m2p), " modules." ); |
|
557
|
|
|
|
|
|
|
|
|
558
|
|
|
|
|
|
|
# return the Foo::Bar => /whatever/Foo/Bar.pod|pm hashref |
|
559
|
1
|
|
|
|
|
12
|
return $m2p; |
|
560
|
|
|
|
|
|
|
} |
|
561
|
|
|
|
|
|
|
|
|
562
|
|
|
|
|
|
|
#=========================================================================== |
|
563
|
|
|
|
|
|
|
|
|
564
|
|
|
|
|
|
|
sub _wopen { |
|
565
|
|
|
|
|
|
|
# this is abstracted out so that the daemon class can override it |
|
566
|
13
|
|
|
13
|
|
28
|
my($self, $outpath) = @_; |
|
567
|
13
|
|
|
|
|
973
|
require Symbol; |
|
568
|
13
|
|
|
|
|
1205
|
my $out_fh = Symbol::gensym(); |
|
569
|
13
|
|
|
|
|
169
|
DEBUG > 5 and print STDERR "Write-opening to $outpath\n"; |
|
570
|
13
|
50
|
|
|
|
1827
|
return $out_fh if open($out_fh, "> $outpath"); |
|
571
|
0
|
|
|
|
|
0
|
require Carp; |
|
572
|
0
|
|
|
|
|
0
|
Carp::croak("Can't write-open $outpath: $!"); |
|
573
|
|
|
|
|
|
|
} |
|
574
|
|
|
|
|
|
|
|
|
575
|
|
|
|
|
|
|
#========================================================================== |
|
576
|
|
|
|
|
|
|
|
|
577
|
|
|
|
|
|
|
sub add_css { |
|
578
|
11
|
|
|
11
|
1
|
27
|
my($self, $url, $is_default, $name, $content_type, $media, $_code) = @_; |
|
579
|
11
|
50
|
|
|
|
23
|
return unless $url; |
|
580
|
11
|
50
|
|
|
|
21
|
unless($name) { |
|
581
|
|
|
|
|
|
|
# cook up a reasonable name based on the URL |
|
582
|
0
|
|
|
|
|
0
|
$name = $url; |
|
583
|
0
|
0
|
0
|
|
|
0
|
if( $name !~ m/\?/ and $name =~ m{([^/]+)$}s ) { |
|
584
|
0
|
|
|
|
|
0
|
$name = $1; |
|
585
|
0
|
|
|
|
|
0
|
$name =~ s/\.css//i; |
|
586
|
|
|
|
|
|
|
} |
|
587
|
|
|
|
|
|
|
} |
|
588
|
11
|
|
50
|
|
|
51
|
$media ||= 'all'; |
|
589
|
11
|
|
50
|
|
|
42
|
$content_type ||= 'text/css'; |
|
590
|
|
|
|
|
|
|
|
|
591
|
11
|
|
|
|
|
29
|
my $bunch = [$url, $name, $content_type, $media, $_code]; |
|
592
|
11
|
50
|
|
|
|
23
|
if($is_default) { unshift @{ $self->_css_wad }, $bunch } |
|
|
0
|
|
|
|
|
0
|
|
|
|
0
|
|
|
|
|
0
|
|
|
593
|
11
|
|
|
|
|
16
|
else { push @{ $self->_css_wad }, $bunch } |
|
|
11
|
|
|
|
|
28
|
|
|
594
|
11
|
|
|
|
|
37
|
return; |
|
595
|
|
|
|
|
|
|
} |
|
596
|
|
|
|
|
|
|
|
|
597
|
|
|
|
|
|
|
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
|
598
|
|
|
|
|
|
|
|
|
599
|
|
|
|
|
|
|
sub _spray_css { |
|
600
|
1
|
|
|
1
|
|
8
|
my($self, $outdir) = @_; |
|
601
|
|
|
|
|
|
|
|
|
602
|
1
|
50
|
|
|
|
6
|
return unless $self->css_flurry(); |
|
603
|
1
|
|
|
|
|
9
|
$self->_gen_css_wad(); |
|
604
|
|
|
|
|
|
|
|
|
605
|
1
|
|
|
|
|
4
|
my $lol = $self->_css_wad; |
|
606
|
1
|
|
|
|
|
9
|
foreach my $chunk (@$lol) { |
|
607
|
11
|
|
|
|
|
26
|
my $url = $chunk->[0]; |
|
608
|
11
|
|
|
|
|
15
|
my $outfile; |
|
609
|
11
|
50
|
33
|
|
|
115
|
if( ref($chunk->[-1]) and $url =~ m{^(_[-a-z0-9_]+\.css$)} ) { |
|
610
|
11
|
|
|
|
|
43
|
$outfile = $self->filespecsys->catfile( $outdir, "$1" ); |
|
611
|
11
|
|
|
|
|
34
|
DEBUG > 5 and print STDERR "Noting $$chunk[0] as a file I'll create.\n"; |
|
612
|
|
|
|
|
|
|
} else { |
|
613
|
0
|
|
|
|
|
0
|
DEBUG > 5 and print STDERR "OK, noting $$chunk[0] as an external CSS.\n"; |
|
614
|
|
|
|
|
|
|
# Requires no further attention. |
|
615
|
0
|
|
|
|
|
0
|
next; |
|
616
|
|
|
|
|
|
|
} |
|
617
|
|
|
|
|
|
|
|
|
618
|
|
|
|
|
|
|
#$self->muse( "Writing autogenerated CSS file $outfile" ); |
|
619
|
11
|
|
|
|
|
27
|
my $Cssout = $self->_wopen($outfile); |
|
620
|
11
|
50
|
|
|
|
39
|
print $Cssout ${$chunk->[-1]} |
|
|
11
|
|
|
|
|
71
|
|
|
621
|
|
|
|
|
|
|
or warn "Couldn't print to $outfile: $!\nAbort writing to $outfile at all"; |
|
622
|
11
|
|
|
|
|
414
|
close($Cssout); |
|
623
|
11
|
|
|
|
|
66
|
DEBUG > 5 and print STDERR "Wrote $outfile\n"; |
|
624
|
|
|
|
|
|
|
} |
|
625
|
|
|
|
|
|
|
|
|
626
|
1
|
|
|
|
|
5
|
return; |
|
627
|
|
|
|
|
|
|
} |
|
628
|
|
|
|
|
|
|
|
|
629
|
|
|
|
|
|
|
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
|
630
|
|
|
|
|
|
|
|
|
631
|
|
|
|
|
|
|
sub _css_wad_to_markup { |
|
632
|
11
|
|
|
11
|
|
21
|
my($self, $depth) = @_; |
|
633
|
|
|
|
|
|
|
|
|
634
|
11
|
50
|
|
|
|
18
|
my @css = @{ $self->_css_wad || return '' }; |
|
|
11
|
|
|
|
|
27
|
|
|
635
|
11
|
50
|
|
|
|
28
|
return '' unless @css; |
|
636
|
|
|
|
|
|
|
|
|
637
|
11
|
|
|
|
|
19
|
my $rel = 'stylesheet'; |
|
638
|
11
|
|
|
|
|
17
|
my $out = ''; |
|
639
|
|
|
|
|
|
|
|
|
640
|
11
|
|
|
|
|
14
|
--$depth; |
|
641
|
11
|
100
|
|
|
|
30
|
my $uplink = $depth ? ('../' x $depth) : ''; |
|
642
|
|
|
|
|
|
|
|
|
643
|
11
|
|
|
|
|
24
|
foreach my $chunk (@css) { |
|
644
|
121
|
50
|
33
|
|
|
375
|
next unless $chunk and @$chunk; |
|
645
|
|
|
|
|
|
|
|
|
646
|
121
|
|
|
|
|
295
|
my( $url1, $url2, $title, $type, $media) = ( |
|
647
|
|
|
|
|
|
|
$self->_maybe_uplink( $chunk->[0], $uplink ), |
|
648
|
|
|
|
|
|
|
esc(grep !ref($_), @$chunk) |
|
649
|
|
|
|
|
|
|
); |
|
650
|
|
|
|
|
|
|
|
|
651
|
121
|
|
|
|
|
326
|
$out .= qq{\n}; |
|
652
|
|
|
|
|
|
|
|
|
653
|
121
|
|
|
|
|
229
|
$rel = 'alternate stylesheet'; # alternates = all non-first iterations |
|
654
|
|
|
|
|
|
|
} |
|
655
|
11
|
|
|
|
|
58
|
return $out; |
|
656
|
|
|
|
|
|
|
} |
|
657
|
|
|
|
|
|
|
|
|
658
|
|
|
|
|
|
|
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
|
659
|
|
|
|
|
|
|
sub _maybe_uplink { |
|
660
|
|
|
|
|
|
|
# if the given URL looks relative, return the given uplink string -- |
|
661
|
|
|
|
|
|
|
# otherwise return emptystring |
|
662
|
132
|
|
|
132
|
|
229
|
my($self, $url, $uplink) = @_; |
|
663
|
132
|
50
|
33
|
|
|
793
|
($url =~ m{^\./} or $url !~ m{[/\:]} ) |
|
664
|
|
|
|
|
|
|
? $uplink |
|
665
|
|
|
|
|
|
|
: '' |
|
666
|
|
|
|
|
|
|
# qualify it, if/as needed |
|
667
|
|
|
|
|
|
|
} |
|
668
|
|
|
|
|
|
|
|
|
669
|
|
|
|
|
|
|
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
|
670
|
|
|
|
|
|
|
sub _gen_css_wad { |
|
671
|
1
|
|
|
1
|
|
3
|
my $self = $_[0]; |
|
672
|
1
|
|
|
|
|
8
|
my $css_template = $self->_css_template; |
|
673
|
1
|
|
|
|
|
8
|
foreach my $variation ( |
|
674
|
|
|
|
|
|
|
|
|
675
|
|
|
|
|
|
|
# Commented out for sake of concision: |
|
676
|
|
|
|
|
|
|
# |
|
677
|
|
|
|
|
|
|
# 011n=black_with_red_on_white |
|
678
|
|
|
|
|
|
|
# 001n=black_with_yellow_on_white |
|
679
|
|
|
|
|
|
|
# 101n=black_with_green_on_white |
|
680
|
|
|
|
|
|
|
# 110=white_with_yellow_on_black |
|
681
|
|
|
|
|
|
|
# 010=white_with_green_on_black |
|
682
|
|
|
|
|
|
|
# 011=white_with_blue_on_black |
|
683
|
|
|
|
|
|
|
# 100=white_with_red_on_black |
|
684
|
|
|
|
|
|
|
'110n=blkbluw', # black_with_blue_on_white |
|
685
|
|
|
|
|
|
|
'010n=blkmagw', # black_with_magenta_on_white |
|
686
|
|
|
|
|
|
|
'100n=blkcynw', # black_with_cyan_on_white |
|
687
|
|
|
|
|
|
|
'101=whtprpk', # white_with_purple_on_black |
|
688
|
|
|
|
|
|
|
'001=whtnavk', # white_with_navy_blue_on_black |
|
689
|
|
|
|
|
|
|
'010a=grygrnk', # grey_with_green_on_black |
|
690
|
|
|
|
|
|
|
'010b=whtgrng', # white_with_green_on_grey |
|
691
|
|
|
|
|
|
|
'101an=blkgrng', # black_with_green_on_grey |
|
692
|
|
|
|
|
|
|
'101bn=grygrnw', # grey_with_green_on_white |
|
693
|
|
|
|
|
|
|
) { |
|
694
|
|
|
|
|
|
|
|
|
695
|
9
|
|
|
|
|
27
|
my $outname = $variation; |
|
696
|
9
|
50
|
100
|
|
|
112
|
my($flipmode, @swap) = ( ($4 || ''), $1,$2,$3) |
|
697
|
|
|
|
|
|
|
if $outname =~ s/^([012])([012])([[012])([a-z]*)=?//s; |
|
698
|
9
|
100
|
|
|
|
33
|
@swap = () if '010' eq join '', @swap; # 010 is a swop-no-op! |
|
699
|
|
|
|
|
|
|
|
|
700
|
9
|
|
|
|
|
107
|
my $this_css = |
|
701
|
|
|
|
|
|
|
"/* This file is autogenerated. Do not edit. $variation */\n\n" |
|
702
|
|
|
|
|
|
|
. $css_template; |
|
703
|
|
|
|
|
|
|
|
|
704
|
|
|
|
|
|
|
# Only look at three-digitty colors, for now at least. |
|
705
|
9
|
100
|
|
|
|
37
|
if( $flipmode =~ m/n/ ) { |
|
706
|
5
|
|
|
|
|
41
|
$this_css =~ s/(#[0-9a-fA-F]{3})\b/_color_negate($1)/eg; |
|
|
110
|
|
|
|
|
219
|
|
|
707
|
5
|
|
|
|
|
172
|
$this_css =~ s/\bthin\b/medium/g; |
|
708
|
|
|
|
|
|
|
} |
|
709
|
9
|
100
|
|
|
|
58
|
$this_css =~ s<#([0-9a-fA-F])([0-9a-fA-F])([0-9a-fA-F])\b> |
|
|
132
|
|
|
|
|
436
|
|
|
710
|
|
|
|
|
|
|
< join '', '#', ($1,$2,$3)[@swap] >eg if @swap; |
|
711
|
9
|
100
|
|
|
|
36
|
|
|
|
|
100
|
|
|
|
|
|
|
712
|
2
|
|
|
|
|
56
|
if( $flipmode =~ m/a/) |
|
713
|
|
|
|
|
|
|
{ $this_css =~ s/#fff\b/#999/gi } # black -> dark grey |
|
714
|
2
|
|
|
|
|
38
|
elsif($flipmode =~ m/b/) |
|
715
|
|
|
|
|
|
|
{ $this_css =~ s/#000\b/#666/gi } # white -> light grey |
|
716
|
9
|
|
|
|
|
21
|
|
|
717
|
9
|
|
|
|
|
26
|
my $name = $outname; |
|
718
|
9
|
|
|
|
|
57
|
$name =~ tr/-_/ /; |
|
719
|
|
|
|
|
|
|
$self->add_css( "_$outname.css", 0, $name, 0, 0, \$this_css); |
|
720
|
|
|
|
|
|
|
} |
|
721
|
|
|
|
|
|
|
|
|
722
|
1
|
|
|
|
|
3
|
# Now a few indexless variations: |
|
723
|
1
|
|
|
|
|
15
|
for (my ($outfile, $variation) = each %{{ |
|
724
|
|
|
|
|
|
|
blkbluw => 'black_with_blue_on_white', |
|
725
|
|
|
|
|
|
|
whtpurk => 'white_with_purple_on_black', |
|
726
|
|
|
|
|
|
|
whtgrng => 'white_with_green_on_grey', |
|
727
|
|
|
|
|
|
|
grygrnw => 'grey_with_green_on_white', |
|
728
|
2
|
|
|
|
|
11
|
}}) { |
|
729
|
|
|
|
|
|
|
my $this_css = join "\n", |
|
730
|
|
|
|
|
|
|
"/* This file is autogenerated. Do not edit. $outfile */\n", |
|
731
|
|
|
|
|
|
|
"\@import url(\"./_$variation.css\");", |
|
732
|
|
|
|
|
|
|
".indexgroup { display: none; }", |
|
733
|
|
|
|
|
|
|
"\n", |
|
734
|
2
|
|
|
|
|
4
|
; |
|
735
|
2
|
|
|
|
|
4
|
my $name = $outfile; |
|
736
|
2
|
|
|
|
|
14
|
$name =~ tr/-_/ /; |
|
737
|
|
|
|
|
|
|
$self->add_css( "_$outfile.css", 0, $name, 0, 0, \$this_css); |
|
738
|
|
|
|
|
|
|
} |
|
739
|
1
|
|
|
|
|
4
|
|
|
740
|
|
|
|
|
|
|
return; |
|
741
|
|
|
|
|
|
|
} |
|
742
|
|
|
|
|
|
|
|
|
743
|
110
|
|
|
110
|
|
176
|
sub _color_negate { |
|
744
|
110
|
|
|
|
|
156
|
my $x = lc $_[0]; |
|
745
|
|
|
|
|
|
|
$x =~ tr[0123456789abcdef] |
|
746
|
110
|
|
|
|
|
533
|
[fedcba9876543210]; |
|
747
|
|
|
|
|
|
|
return $x; |
|
748
|
|
|
|
|
|
|
} |
|
749
|
|
|
|
|
|
|
|
|
750
|
|
|
|
|
|
|
#=========================================================================== |
|
751
|
|
|
|
|
|
|
|
|
752
|
1
|
|
|
1
|
1
|
7
|
sub add_javascript { |
|
753
|
1
|
50
|
|
|
|
14
|
my($self, $url, $content_type, $_code) = @_; |
|
754
|
1
|
|
50
|
|
|
2
|
return unless $url; |
|
|
1
|
|
|
|
|
4
|
|
|
755
|
|
|
|
|
|
|
push @{ $self->_javascript_wad }, [ |
|
756
|
|
|
|
|
|
|
$url, $content_type || 'text/javascript', $_code |
|
757
|
1
|
|
|
|
|
5
|
]; |
|
758
|
|
|
|
|
|
|
return; |
|
759
|
|
|
|
|
|
|
} |
|
760
|
|
|
|
|
|
|
|
|
761
|
1
|
|
|
1
|
|
4
|
sub _spray_javascript { |
|
762
|
1
|
50
|
|
|
|
11
|
my($self, $outdir) = @_; |
|
763
|
1
|
|
|
|
|
5
|
return unless $self->javascript_flurry(); |
|
764
|
|
|
|
|
|
|
$self->_gen_javascript_wad(); |
|
765
|
1
|
|
|
|
|
6
|
|
|
766
|
1
|
|
|
|
|
7
|
my $lol = $self->_javascript_wad; |
|
767
|
1
|
|
|
|
|
3
|
foreach my $script (@$lol) { |
|
768
|
1
|
|
|
|
|
2
|
my $url = $script->[0]; |
|
769
|
|
|
|
|
|
|
my $outfile; |
|
770
|
1
|
50
|
33
|
|
|
19
|
|
|
771
|
1
|
|
|
|
|
5
|
if( ref($script->[-1]) and $url =~ m{^(_[-a-z0-9_]+\.js$)} ) { |
|
772
|
1
|
|
|
|
|
3
|
$outfile = $self->filespecsys->catfile( $outdir, "$1" ); |
|
773
|
|
|
|
|
|
|
DEBUG > 5 and print STDERR "Noting $$script[0] as a file I'll create.\n"; |
|
774
|
0
|
|
|
|
|
0
|
} else { |
|
775
|
0
|
|
|
|
|
0
|
DEBUG > 5 and print STDERR "OK, noting $$script[0] as an external JavaScript.\n"; |
|
776
|
|
|
|
|
|
|
next; |
|
777
|
|
|
|
|
|
|
} |
|
778
|
|
|
|
|
|
|
|
|
779
|
1
|
|
|
|
|
4
|
#$self->muse( "Writing JavaScript file $outfile" ); |
|
780
|
|
|
|
|
|
|
my $Jsout = $self->_wopen($outfile); |
|
781
|
1
|
50
|
|
|
|
5
|
|
|
|
1
|
|
|
|
|
9
|
|
|
782
|
|
|
|
|
|
|
print $Jsout ${$script->[-1]} |
|
783
|
1
|
|
|
|
|
28
|
or warn "Couldn't print to $outfile: $!\nAbort writing to $outfile at all"; |
|
784
|
1
|
|
|
|
|
7
|
close($Jsout); |
|
785
|
|
|
|
|
|
|
DEBUG > 5 and print STDERR "Wrote $outfile\n"; |
|
786
|
|
|
|
|
|
|
} |
|
787
|
1
|
|
|
|
|
3
|
|
|
788
|
|
|
|
|
|
|
return; |
|
789
|
|
|
|
|
|
|
} |
|
790
|
|
|
|
|
|
|
|
|
791
|
1
|
|
|
1
|
|
2
|
sub _gen_javascript_wad { |
|
792
|
1
|
|
50
|
|
|
10
|
my $self = $_[0]; |
|
793
|
1
|
|
|
|
|
5
|
my $js_code = $self->_javascript || return; |
|
794
|
1
|
|
|
|
|
6
|
$self->add_javascript( "_podly.js", 0, \$js_code); |
|
795
|
|
|
|
|
|
|
return; |
|
796
|
|
|
|
|
|
|
} |
|
797
|
|
|
|
|
|
|
|
|
798
|
11
|
|
|
11
|
|
22
|
sub _javascript_wad_to_markup { |
|
799
|
|
|
|
|
|
|
my($self, $depth) = @_; |
|
800
|
11
|
50
|
|
|
|
17
|
|
|
|
11
|
|
|
|
|
24
|
|
|
801
|
11
|
50
|
|
|
|
27
|
my @scripts = @{ $self->_javascript_wad || return '' }; |
|
802
|
|
|
|
|
|
|
return '' unless @scripts; |
|
803
|
11
|
|
|
|
|
27
|
|
|
804
|
|
|
|
|
|
|
my $out = ''; |
|
805
|
11
|
|
|
|
|
19
|
|
|
806
|
11
|
100
|
|
|
|
28
|
--$depth; |
|
807
|
|
|
|
|
|
|
my $uplink = $depth ? ('../' x $depth) : ''; |
|
808
|
11
|
|
|
|
|
24
|
|
|
809
|
11
|
50
|
33
|
|
|
56
|
foreach my $s (@scripts) { |
|
810
|
|
|
|
|
|
|
next unless $s and @$s; |
|
811
|
11
|
|
|
|
|
62
|
|
|
812
|
|
|
|
|
|
|
my( $url1, $url2, $type, $media) = ( |
|
813
|
|
|
|
|
|
|
$self->_maybe_uplink( $s->[0], $uplink ), |
|
814
|
|
|
|
|
|
|
esc(grep !ref($_), @$s) |
|
815
|
|
|
|
|
|
|
); |
|
816
|
11
|
|
|
|
|
43
|
|
|
817
|
|
|
|
|
|
|
$out .= qq{\n}; |
|
818
|
11
|
|
|
|
|
54
|
} |
|
819
|
|
|
|
|
|
|
return $out; |
|
820
|
|
|
|
|
|
|
} |
|
821
|
|
|
|
|
|
|
|
|
822
|
|
|
|
|
|
|
#=========================================================================== |
|
823
|
1
|
|
|
1
|
|
8
|
|
|
824
|
1
|
|
|
1
|
|
5
|
sub _css_template { return $CSS } |
|
825
|
|
|
|
|
|
|
sub _javascript { return $JAVASCRIPT } |
|
826
|
|
|
|
|
|
|
|
|
827
|
|
|
|
|
|
|
$CSS = <<'EOCSS'; |
|
828
|
|
|
|
|
|
|
/* For accessibility reasons, never specify text sizes in px/pt/pc/in/cm/mm */ |
|
829
|
|
|
|
|
|
|
|
|
830
|
|
|
|
|
|
|
@media all { .hide { display: none; } } |
|
831
|
|
|
|
|
|
|
|
|
832
|
|
|
|
|
|
|
@media print { |
|
833
|
|
|
|
|
|
|
.noprint, div.indexgroup, .backlinktop, .backlinkbottom { display: none } |
|
834
|
|
|
|
|
|
|
|
|
835
|
|
|
|
|
|
|
* { |
|
836
|
|
|
|
|
|
|
border-color: black !important; |
|
837
|
|
|
|
|
|
|
color: black !important; |
|
838
|
|
|
|
|
|
|
background-color: transparent !important; |
|
839
|
|
|
|
|
|
|
background-image: none !important; |
|
840
|
|
|
|
|
|
|
} |
|
841
|
|
|
|
|
|
|
|
|
842
|
|
|
|
|
|
|
dl.superindex > dd { |
|
843
|
|
|
|
|
|
|
word-spacing: .6em; |
|
844
|
|
|
|
|
|
|
} |
|
845
|
|
|
|
|
|
|
} |
|
846
|
|
|
|
|
|
|
|
|
847
|
|
|
|
|
|
|
@media aural, braille, embossed { |
|
848
|
|
|
|
|
|
|
div.indexgroup { display: none; } /* Too noisy, don't you think? */ |
|
849
|
|
|
|
|
|
|
dl.superindex > dt:before { content: "Group "; } |
|
850
|
|
|
|
|
|
|
dl.superindex > dt:after { content: " contains:"; } |
|
851
|
|
|
|
|
|
|
.backlinktop a:before { content: "Back to contents"; } |
|
852
|
|
|
|
|
|
|
.backlinkbottom a:before { content: "Back to contents"; } |
|
853
|
|
|
|
|
|
|
} |
|
854
|
|
|
|
|
|
|
|
|
855
|
|
|
|
|
|
|
@media aural { |
|
856
|
|
|
|
|
|
|
dl.superindex > dt { pause-before: 600ms; } |
|
857
|
|
|
|
|
|
|
} |
|
858
|
|
|
|
|
|
|
|
|
859
|
|
|
|
|
|
|
@media screen, tty, tv, projection { |
|
860
|
|
|
|
|
|
|
.noscreen { display: none; } |
|
861
|
|
|
|
|
|
|
|
|
862
|
|
|
|
|
|
|
a:link { color: #7070ff; text-decoration: underline; } |
|
863
|
|
|
|
|
|
|
a:visited { color: #e030ff; text-decoration: underline; } |
|
864
|
|
|
|
|
|
|
a:active { color: #800000; text-decoration: underline; } |
|
865
|
|
|
|
|
|
|
body.contentspage a { text-decoration: none; } |
|
866
|
|
|
|
|
|
|
a.u { color: #fff !important; text-decoration: none; } |
|
867
|
|
|
|
|
|
|
|
|
868
|
|
|
|
|
|
|
body.pod { |
|
869
|
|
|
|
|
|
|
margin: 0 5px; |
|
870
|
|
|
|
|
|
|
color: #fff; |
|
871
|
|
|
|
|
|
|
background-color: #000; |
|
872
|
|
|
|
|
|
|
} |
|
873
|
|
|
|
|
|
|
|
|
874
|
|
|
|
|
|
|
body.pod h1, body.pod h2, body.pod h3, |
|
875
|
|
|
|
|
|
|
body.pod h4, body.pod h5, body.pod h6 { |
|
876
|
|
|
|
|
|
|
font-family: Tahoma, Verdana, Helvetica, Arial, sans-serif; |
|
877
|
|
|
|
|
|
|
font-weight: normal; |
|
878
|
|
|
|
|
|
|
margin-top: 1.2em; |
|
879
|
|
|
|
|
|
|
margin-bottom: .1em; |
|
880
|
|
|
|
|
|
|
border-top: thin solid transparent; |
|
881
|
|
|
|
|
|
|
/* margin-left: -5px; border-left: 2px #7070ff solid; padding-left: 3px; */ |
|
882
|
|
|
|
|
|
|
} |
|
883
|
|
|
|
|
|
|
|
|
884
|
|
|
|
|
|
|
body.pod h1 { border-top-color: #0a0; } |
|
885
|
|
|
|
|
|
|
body.pod h2 { border-top-color: #080; } |
|
886
|
|
|
|
|
|
|
body.pod h3 { border-top-color: #040; } |
|
887
|
|
|
|
|
|
|
body.pod h4 { border-top-color: #010; } |
|
888
|
|
|
|
|
|
|
body.pod h5 { border-top-color: #010; } |
|
889
|
|
|
|
|
|
|
body.pod h6 { border-top-color: #010; } |
|
890
|
|
|
|
|
|
|
|
|
891
|
|
|
|
|
|
|
p.backlinktop + h1 { border-top: none; margin-top: 0em; } |
|
892
|
|
|
|
|
|
|
p.backlinktop + h2 { border-top: none; margin-top: 0em; } |
|
893
|
|
|
|
|
|
|
p.backlinktop + h3 { border-top: none; margin-top: 0em; } |
|
894
|
|
|
|
|
|
|
p.backlinktop + h4 { border-top: none; margin-top: 0em; } |
|
895
|
|
|
|
|
|
|
p.backlinktop + h5 { border-top: none; margin-top: 0em; } |
|
896
|
|
|
|
|
|
|
p.backlinktop + h6 { border-top: none; margin-top: 0em; } |
|
897
|
|
|
|
|
|
|
|
|
898
|
|
|
|
|
|
|
body.pod dt { |
|
899
|
|
|
|
|
|
|
font-size: 105%; /* just a wee bit more than normal */ |
|
900
|
|
|
|
|
|
|
} |
|
901
|
|
|
|
|
|
|
|
|
902
|
|
|
|
|
|
|
.indexgroup { font-size: 80%; } |
|
903
|
|
|
|
|
|
|
|
|
904
|
|
|
|
|
|
|
.backlinktop, .backlinkbottom { |
|
905
|
|
|
|
|
|
|
margin-left: -5px; |
|
906
|
|
|
|
|
|
|
margin-right: -5px; |
|
907
|
|
|
|
|
|
|
background-color: #040; |
|
908
|
|
|
|
|
|
|
border-top: thin solid #050; |
|
909
|
|
|
|
|
|
|
border-bottom: thin solid #050; |
|
910
|
|
|
|
|
|
|
} |
|
911
|
|
|
|
|
|
|
|
|
912
|
|
|
|
|
|
|
.backlinktop a, .backlinkbottom a { |
|
913
|
|
|
|
|
|
|
text-decoration: none; |
|
914
|
|
|
|
|
|
|
color: #080; |
|
915
|
|
|
|
|
|
|
background-color: #000; |
|
916
|
|
|
|
|
|
|
border: thin solid #0d0; |
|
917
|
|
|
|
|
|
|
} |
|
918
|
|
|
|
|
|
|
.backlinkbottom { margin-bottom: 0; padding-bottom: 0; } |
|
919
|
|
|
|
|
|
|
.backlinktop { margin-top: 0; padding-top: 0; } |
|
920
|
|
|
|
|
|
|
|
|
921
|
|
|
|
|
|
|
body.contentspage { |
|
922
|
|
|
|
|
|
|
color: #fff; |
|
923
|
|
|
|
|
|
|
background-color: #000; |
|
924
|
|
|
|
|
|
|
} |
|
925
|
|
|
|
|
|
|
|
|
926
|
|
|
|
|
|
|
body.contentspage h1 { |
|
927
|
|
|
|
|
|
|
color: #0d0; |
|
928
|
|
|
|
|
|
|
margin-left: 1em; |
|
929
|
|
|
|
|
|
|
margin-right: 1em; |
|
930
|
|
|
|
|
|
|
text-indent: -.9em; |
|
931
|
|
|
|
|
|
|
font-family: Tahoma, Verdana, Helvetica, Arial, sans-serif; |
|
932
|
|
|
|
|
|
|
font-weight: normal; |
|
933
|
|
|
|
|
|
|
border-top: thin solid #fff; |
|
934
|
|
|
|
|
|
|
border-bottom: thin solid #fff; |
|
935
|
|
|
|
|
|
|
text-align: center; |
|
936
|
|
|
|
|
|
|
} |
|
937
|
|
|
|
|
|
|
|
|
938
|
|
|
|
|
|
|
dl.superindex > dt { |
|
939
|
|
|
|
|
|
|
font-family: Tahoma, Verdana, Helvetica, Arial, sans-serif; |
|
940
|
|
|
|
|
|
|
font-weight: normal; |
|
941
|
|
|
|
|
|
|
font-size: 90%; |
|
942
|
|
|
|
|
|
|
margin-top: .45em; |
|
943
|
|
|
|
|
|
|
/* margin-bottom: -.15em; */ |
|
944
|
|
|
|
|
|
|
} |
|
945
|
|
|
|
|
|
|
dl.superindex > dd { |
|
946
|
|
|
|
|
|
|
word-spacing: .6em; /* most important rule here! */ |
|
947
|
|
|
|
|
|
|
} |
|
948
|
|
|
|
|
|
|
dl.superindex > a:link { |
|
949
|
|
|
|
|
|
|
text-decoration: none; |
|
950
|
|
|
|
|
|
|
color: #fff; |
|
951
|
|
|
|
|
|
|
} |
|
952
|
|
|
|
|
|
|
|
|
953
|
|
|
|
|
|
|
.contentsfooty { |
|
954
|
|
|
|
|
|
|
border-top: thin solid #999; |
|
955
|
|
|
|
|
|
|
font-size: 90%; |
|
956
|
|
|
|
|
|
|
} |
|
957
|
|
|
|
|
|
|
|
|
958
|
|
|
|
|
|
|
} |
|
959
|
|
|
|
|
|
|
|
|
960
|
|
|
|
|
|
|
/* The End */ |
|
961
|
|
|
|
|
|
|
|
|
962
|
|
|
|
|
|
|
EOCSS |
|
963
|
|
|
|
|
|
|
|
|
964
|
|
|
|
|
|
|
#========================================================================== |
|
965
|
|
|
|
|
|
|
|
|
966
|
|
|
|
|
|
|
$JAVASCRIPT = <<'EOJAVASCRIPT'; |
|
967
|
|
|
|
|
|
|
|
|
968
|
|
|
|
|
|
|
// From http://www.alistapart.com/articles/alternate/ |
|
969
|
|
|
|
|
|
|
|
|
970
|
|
|
|
|
|
|
function setActiveStyleSheet(title) { |
|
971
|
|
|
|
|
|
|
var i, a, main; |
|
972
|
|
|
|
|
|
|
for(i=0 ; (a = document.getElementsByTagName("link")[i]) ; i++) { |
|
973
|
|
|
|
|
|
|
if(a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("title")) { |
|
974
|
|
|
|
|
|
|
a.disabled = true; |
|
975
|
|
|
|
|
|
|
if(a.getAttribute("title") == title) a.disabled = false; |
|
976
|
|
|
|
|
|
|
} |
|
977
|
|
|
|
|
|
|
} |
|
978
|
|
|
|
|
|
|
} |
|
979
|
|
|
|
|
|
|
|
|
980
|
|
|
|
|
|
|
function getActiveStyleSheet() { |
|
981
|
|
|
|
|
|
|
var i, a; |
|
982
|
|
|
|
|
|
|
for(i=0 ; (a = document.getElementsByTagName("link")[i]) ; i++) { |
|
983
|
|
|
|
|
|
|
if( a.getAttribute("rel").indexOf("style") != -1 |
|
984
|
|
|
|
|
|
|
&& a.getAttribute("title") |
|
985
|
|
|
|
|
|
|
&& !a.disabled |
|
986
|
|
|
|
|
|
|
) return a.getAttribute("title"); |
|
987
|
|
|
|
|
|
|
} |
|
988
|
|
|
|
|
|
|
return null; |
|
989
|
|
|
|
|
|
|
} |
|
990
|
|
|
|
|
|
|
|
|
991
|
|
|
|
|
|
|
function getPreferredStyleSheet() { |
|
992
|
|
|
|
|
|
|
var i, a; |
|
993
|
|
|
|
|
|
|
for(i=0 ; (a = document.getElementsByTagName("link")[i]) ; i++) { |
|
994
|
|
|
|
|
|
|
if( a.getAttribute("rel").indexOf("style") != -1 |
|
995
|
|
|
|
|
|
|
&& a.getAttribute("rel").indexOf("alt") == -1 |
|
996
|
|
|
|
|
|
|
&& a.getAttribute("title") |
|
997
|
|
|
|
|
|
|
) return a.getAttribute("title"); |
|
998
|
|
|
|
|
|
|
} |
|
999
|
|
|
|
|
|
|
return null; |
|
1000
|
|
|
|
|
|
|
} |
|
1001
|
|
|
|
|
|
|
|
|
1002
|
|
|
|
|
|
|
function createCookie(name,value,days) { |
|
1003
|
|
|
|
|
|
|
if (days) { |
|
1004
|
|
|
|
|
|
|
var date = new Date(); |
|
1005
|
|
|
|
|
|
|
date.setTime(date.getTime()+(days*24*60*60*1000)); |
|
1006
|
|
|
|
|
|
|
var expires = "; expires="+date.toGMTString(); |
|
1007
|
|
|
|
|
|
|
} |
|
1008
|
|
|
|
|
|
|
else expires = ""; |
|
1009
|
|
|
|
|
|
|
document.cookie = name+"="+value+expires+"; path=/"; |
|
1010
|
|
|
|
|
|
|
} |
|
1011
|
|
|
|
|
|
|
|
|
1012
|
|
|
|
|
|
|
function readCookie(name) { |
|
1013
|
|
|
|
|
|
|
var nameEQ = name + "="; |
|
1014
|
|
|
|
|
|
|
var ca = document.cookie.split(';'); |
|
1015
|
|
|
|
|
|
|
for(var i=0 ; i < ca.length ; i++) { |
|
1016
|
|
|
|
|
|
|
var c = ca[i]; |
|
1017
|
|
|
|
|
|
|
while (c.charAt(0)==' ') c = c.substring(1,c.length); |
|
1018
|
|
|
|
|
|
|
if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length); |
|
1019
|
|
|
|
|
|
|
} |
|
1020
|
|
|
|
|
|
|
return null; |
|
1021
|
|
|
|
|
|
|
} |
|
1022
|
|
|
|
|
|
|
|
|
1023
|
|
|
|
|
|
|
window.onload = function(e) { |
|
1024
|
|
|
|
|
|
|
var cookie = readCookie("style"); |
|
1025
|
|
|
|
|
|
|
var title = cookie ? cookie : getPreferredStyleSheet(); |
|
1026
|
|
|
|
|
|
|
setActiveStyleSheet(title); |
|
1027
|
|
|
|
|
|
|
} |
|
1028
|
|
|
|
|
|
|
|
|
1029
|
|
|
|
|
|
|
window.onunload = function(e) { |
|
1030
|
|
|
|
|
|
|
var title = getActiveStyleSheet(); |
|
1031
|
|
|
|
|
|
|
createCookie("style", title, 365); |
|
1032
|
|
|
|
|
|
|
} |
|
1033
|
|
|
|
|
|
|
|
|
1034
|
|
|
|
|
|
|
var cookie = readCookie("style"); |
|
1035
|
|
|
|
|
|
|
var title = cookie ? cookie : getPreferredStyleSheet(); |
|
1036
|
|
|
|
|
|
|
setActiveStyleSheet(title); |
|
1037
|
|
|
|
|
|
|
|
|
1038
|
|
|
|
|
|
|
// The End |
|
1039
|
|
|
|
|
|
|
|
|
1040
|
|
|
|
|
|
|
EOJAVASCRIPT |
|
1041
|
|
|
|
|
|
|
|
|
1042
|
|
|
|
|
|
|
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
|
1043
|
|
|
|
|
|
|
1; |
|
1044
|
|
|
|
|
|
|
__END__ |