Changeset 10404


Ignore:
Timestamp:
2005-08-03T13:26:08+12:00 (19 years ago)
Author:
chi
Message:

remove the plugin arguments to WordPlug.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl/perllib/plugins/StructuredHTMLPlug.pm

    r10356 r10404  
    22#
    33# StructuredHTMLPlug.pm -- html plugin with extra facilities for teasing out
    4 # hierarchical structure (such as h1, h2, h3 tags) in an HTML document
     4# hierarchical structure (such as h1, h2, h3, or user-defined tags) in an
     5# HTML document
    56#
    67# A component of the Greenstone digital library software
     
    2526#
    2627###########################################################################
     28# This plugin is to process an HTML file where sections are divided by
     29# user-defined headings tags. As it is difficult to predict what user's definition
     30# this plugin allows to detect the user-defined titles up to three levels (level1, level2, level3...)
     31# as well as allows to get rid of user-defined Table of Content (TOC)...
     32# format:e.g. level1 (Abstract_title|ChapterTitle|Referencing Heading) level2(SectionHeading)...
     33
    2734package StructuredHTMLPlug;
    2835
     
    3037use ImagePlug;
    3138
     39#use strict; # every perl program should have this!
     40#no strict 'refs'; # make an exception so we can use variables as filehandles
     41
    3242sub BEGIN {
    33     @ISA = ('HTMLPlug');
    34 }
    35 
    36 my $arguments =
    37     [ { 'name' => "check_toc",
    38     'desc' => "StructuredHTMLPlug.check_toc'}",
    39     'type' => "flag",
    40     'reqd' => "no"},
    41       { 'name' => "title_header",
    42     'desc' => "{StructuredHTMLPlug.title_header}",
    43     'type' => "regexp",
    44     'reqd' => "no"},
    45       { 'name' => "level1_header",
    46     'desc' => "{StructuredHTMLPlug.level1_header}",
    47     'type' => "regexp",
    48     'reqd' => "no"},
    49       { 'name' => "level2_header",
    50     'desc' => "{StructuredHTMLPlug.level2_header}",
    51     'type' => "regexp",
    52     'reqd' => "no"},
    53       { 'name' => "level3_header",
    54     'desc' => "{StructuredHTMLPlug.level3_header}",
    55     'type' => "regexp",
    56     'reqd' => "no"},
    57       { 'name' => "toc_header",
    58     'desc' => "{StructuredHTMLPlug.toc_header}",
    59     'type' => "regexp",
    60     'reqd' => "no"},
    61       { 'name' => "tof_header",
    62     'desc' => "{StructuredHTMLPlug.tof_header}",
    63     'type' => "regexp",
    64     'reqd' => "no"}];
     43    @StructuredHTMLPlug::ISA = ('HTMLPlug');
     44}
     45
     46my $arguments = [];
    6547
    6648my $options = { 'name'     => "StructuredHTMLPlug",
     
    10587sub process {
    10688    my $self = shift (@_);
    107     my ($textref, $pluginfo, $base_dir, $file, $metadata, $doc_obj) = @_;
     89    #my ($textref, $pluginfo, $base_dir, $file, $metadata, $doc_obj) = @_;
     90    my ($textref, $pluginfo, $base_dir, $file, $metadata, $doc_obj, $gli) = @_;
    10891    my $outhandle = $self->{'outhandle'};
    10992
     
    11497    my $head = shift(@head_and_body);
    11598    my $body_text = join("<body", @head_and_body);
    116 
     99   
     100    # If checkout_toc is enables, it means to get rid of toc and tof contents.
    117101    # get rid of TOC and TOF sections and their title
    118     # If check_toc is enables, it means to get rid of toc and tof contents.
    119     if ($self->{'check_toc'}){
     102    if ($self->{'checkout_toc'}){
    120103    #line-height:150%;mso-ansi-language:FR'>Contents<o:p></o:p></span></b></p>
    121104    # get rid of Table of Contents title and Table of Figures
    122     $body_text =~ s/<p[^>]*><b><span[^>]*>(Table of Content.|Content.)<o:p><\/o:p><\/span><\/b><\/p>//isg;
    123     $body_text =~ s/<p[^>]*><b><span[^>]*>(Table of Figure.|Figure.)<o:p><\/o:p><\/span><\/b><\/p>//isg;
     105    #$body_text =~ s/<p[^>]*><b><span[^>]*>(Table of Content.|Content.)<o:p><\/o:p><\/span><\/b><\/p>//isg;
     106    #$body_text =~ s/<p[^>]*><b><span[^>]*>(Table of Figure.|Figure.)<o:p><\/o:p><\/span><\/b><\/p>//isg;
    124107    $body_text =~ s/<p class=(($self->{'toc_header'})[^>]*)>(.+?)<\/p>//isg;
    125108    $body_text =~ s/<p class=(($self->{'tof_header'})[^>]*)>(.+?)<\/p>//isg;
Note: See TracChangeset for help on using the changeset viewer.