Changeset 11990
- Timestamp:
- 07/24/10 20:40:09 (19 months ago)
- File:
-
- 1 edited
-
trunk/Padre/lib/Padre/Document/Perl/Help.pm (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Padre/lib/Padre/Document/Perl/Help.pm
r11742 r11990 14 14 15 15 # for caching help list (for faster access) 16 my ( $cached_help_list, $cached_perlopref );16 my ( $cached_help_list, $cached_perlopref, $cached_wxwidgets ); 17 17 18 18 # Initialize help … … 24 24 $self->{help_list} = $cached_help_list; 25 25 $self->{perlopref} = $cached_perlopref; 26 $self->{wxwidgets} = $cached_wxwidgets; 26 27 return; 27 28 } … … 136 137 push @index, keys %{ $self->{perlopref} }; 137 138 139 # Add wxWidgets documentation 140 $self->{wxwidgets} = $self->_parse_wxwidgets; 141 push @index, keys %{ $self->{wxwidgets} }; 142 138 143 # Return a unique sorted index 139 144 my %seen = (); … … 144 149 $cached_help_list = $self->{help_list}; 145 150 $cached_perlopref = $self->{perlopref}; 151 $cached_wxwidgets = $self->{wxwidgets}; 146 152 } 147 153 … … 205 211 } 206 212 213 # Parses wxwidgets.pod (Perl Operator Reference) 214 sub _parse_wxwidgets { 215 my $self = shift; 216 my %index = (); 217 218 # Open wxwidgets.pod for reading 219 my $wxwidgets = File::Spec->join( Padre::Util::sharedir('doc'), 'wxwidgets', 'wxwidgets.pod' ); 220 if ( open my $fh, '<', $wxwidgets ) { #-# no critic (RequireBriefOpen) 221 # Add PRECEDENCE to index 222 my $line; 223 224 # Add methods to index 225 my $method; 226 while ( $line = <$fh> ) { 227 if ( $line =~ /=head2\s+(.+)$/ ) { 228 $method = $1; 229 $index{$method} = $line; 230 } elsif ($method) { 231 $index{$method} .= $line; 232 } 233 } 234 235 # and we're done 236 close $fh; 237 } else { 238 TRACE("Cannot open wxwidgets.pod\n") if DEBUG; 239 } 240 241 return \%index; 242 } 243 207 244 # Renders the help topic content into XHTML 208 245 sub help_render {
Note: See TracChangeset
for help on using the changeset viewer.
