comparison _doc/make.pl @ 73:2f31ecabe9ea

doc security
author wizard
date Mon, 29 Mar 2010 06:56:05 +0400
parents f47f93534005
children 84aa8c395fce
comparison
equal deleted inserted replaced
72:eac47fa4f262 73:2f31ecabe9ea
156 } 156 }
157 157
158 sub view_seq_link { 158 sub view_seq_link {
159 my ($self,$text) = @_; 159 my ($self,$text) = @_;
160 160
161 if ($text =~ /^\s*(?:(\w+)\s+)?(\w+(?:\:\:\w+)+)\s*$/) { 161 $text =~ s/(\w+(?:\:\:\w+)+)/
162 162 if (my $url = $self->mk_filelink($1)) {
163 my ($keyword, $package) = ($1 || '',$2); 163 "<a href='$url'>$1<\/a>";
164 164 } else {
165 my @path = split /::/, $package; 165 $1;
166 166 }
167 pop @path if $keyword; 167 /gex;
168 shift @path if uc $path[0] eq 'IMPL'; 168
169 169 return "<code>$text</code>";
170 }
171
172 sub mk_filelink {
173 my ($self,$package) = @_;
174
175 return undef unless $package;
176
177 my @path = split /::/, $package;
178
179 if ($path[0] eq 'IMPL') {
180 shift @path;
170 if (-f File::Spec->catfile($LibDir,@path).".pm") { 181 if (-f File::Spec->catfile($LibDir,@path).".pm") {
171 return '<code><a href="'. '../'x($level-1) . File::Spec->catfile(@path) .'.html">'.$text.'</a></code>'; 182 return '../'x($level-1) . File::Spec->catfile(@path).'.html';
172 }
173
174 } elsif ($text =~ /^\s*(\w+(?:\:\:\w+)+)\s*-&gt;\s*(\w+)\s*$/) {
175 my ($package,$member) = ($1,$2);
176
177 my @path = split /::/, $package;
178 shift @path;
179
180 if (-f File::Spec->catfile($LibDir,@path).".pm") {
181 return '<code><a href="'. '../'x($level-1) . File::Spec->catfile(@path) .'.html">'.$text.'</a></code>';
182 } 183 }
183 } 184 }
184 185 return undef;
185 return "<code>$text</code>";
186 } 186 }
187 187
188 sub view_seq_code { 188 sub view_seq_code {
189 goto &view_seq_link; 189 goto &view_seq_link;
190 } 190 }