Changeset 3540 for trunk/gsdl/perllib/plugins/TEXTPlug.pm
- Timestamp:
- 2002-11-18T17:43:56+13:00 (21 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl/perllib/plugins/TEXTPlug.pm
r3037 r3540 27 27 # of first line of text (up to 100 characters long). 28 28 29 # 12/05/02 Added usage datastructure - John Thompson 30 29 31 package TEXTPlug; 30 32 … … 36 38 @ISA = ('BasPlug'); 37 39 } 40 41 my $arguments = [ { 'name' => "process_exp", 42 'desc' => "A perl regular expression to match against filenames. Matching filenames will be processed by this plugin. Each plugin has its own default process_exp. e.g HTMLPlug defaults to '(?i)\.html?\$' i.e. all documents ending in .htm or .html (case-insensitive).", 43 'type' => "string", 44 'deft' => q^(?i)\.te?xt$^, 45 'reqd' => "no" } , 46 { 'name' => "title_sub", 47 'desc' => "Substitution expression to modify string stored as Title. Used by, for example, PSPlug to remove \"Page 1\" etc from text used as the title.", 48 'type' => "string", 49 'reqd' => "no" }]; 50 51 my $options = { 'name' => "TEXTPlug", 52 'desc' => "Creates simple single-level document. Adds Title metadata of first line of text (up to 100 characters long).", 53 'inherits' => "yes", 54 'args' => $arguments }; 38 55 39 56 sub print_usage { … … 50 67 my ($class) = @_; 51 68 my $self = new BasPlug ($class, @_); 69 70 # 14-05-02 To allow for proper inheritance of arguments - John Thompson 71 my $option_list = $self->{'option_list'}; 72 push( @{$option_list}, $options ); 52 73 53 74 if (!parsargv::parse(\@_, … … 87 108 $title =~ /^\s+/s; 88 109 if (defined $self->{'title_sub'} && 89 110 $self->{'title_sub'}) {$title =~ s/$self->{'title_sub'}//;} 90 111 $title =~ /^\s*([^\n]*)/s; $title=$1; 91 112 if (length($title) > 100) {
Note:
See TracChangeset
for help on using the changeset viewer.