Subversion Repositories DevTools

Rev

Rev 361 | Rev 5542 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 361 Rev 4779
Line 63... Line 63...
63
    foreach my $key (sort keys %pods) {
63
    foreach my $key (sort keys %pods) {
64
        
64
        
65
        my $in_file = _relative_path($key, $prefix);
65
        my $in_file = _relative_path($key, $prefix);
66
        if ( $in_file =~ m~TOOLS/LIB~ )
66
        if ( $in_file =~ m~TOOLS/LIB~ )
67
        {
67
        {
-
 
68
            unless ( isaJatsKeyPod($in_file) ) {
68
            print "Ignoring $in_file\n" if $args{verbose};
69
                print "Ignoring $in_file\n" if $args{verbose};
69
            next;
70
                next;
-
 
71
            }
70
        }
72
        }
71
 
73
 
72
        my $out_file = "$htmldir/$in_file";
74
        my $out_file = "$htmldir/$in_file";
73
        $out_file =~ s/\.[a-z]+\z|\z/.html/i;
75
        $out_file =~ s/\.[a-z]+\z|\z/.html/i;
74
        if ($args{force} || !-e $out_file || (stat $in_file)[9] > (stat $out_file)[9]) {
76
        if ($args{force} || !-e $out_file || (stat $in_file)[9] > (stat $out_file)[9]) {
Line 96... Line 98...
96
 
98
 
97
#    pod2html_remove_cache_files($cacheDir);
99
#    pod2html_remove_cache_files($cacheDir);
98
    chdir($starting_cwd) or die "Can't chdir back to '$starting_cwd': $!";
100
    chdir($starting_cwd) or die "Can't chdir back to '$starting_cwd': $!";
99
}
101
}
100
 
102
 
-
 
103
#-------------------------------------------------------------------------------
-
 
104
# Function        : isaJatsKeyPod  
-
 
105
#
-
 
106
# Description     : Test a specified file to see if its a Jats Key Documentation file
-
 
107
#                   Used to filter in POD inn cases where it might outherwise be excluded
-
 
108
#
-
 
109
#                   The test is simple
-
 
110
#                   If the file contains a POD section and that section contains the keyword
-
 
111
#                       =for htmltoc
-
 
112
#                   Then it is assumed that this file conatins JATS POD
-
 
113
#
-
 
114
# Inputs          : $fname      - Path to file to examine
-
 
115
#
-
 
116
# Returns         : True        - Include this file
-
 
117
#
-
 
118
 
-
 
119
sub isaJatsKeyPod
-
 
120
{
-
 
121
    my ($fname) = @_;
-
 
122
    my $podSeen;
-
 
123
    my $jatsKeyPod = 0;
-
 
124
 
-
 
125
    open (my $file, '<', $fname) || return 0;
-
 
126
    while (<$file>) 
-
 
127
    {
-
 
128
        if ( ! $podSeen) {
-
 
129
            if (m~^=pod~) {
-
 
130
                $podSeen = 1;
-
 
131
            }
-
 
132
            next;
-
 
133
        }
-
 
134
 
-
 
135
        if (m~^=head~) {
-
 
136
            last;
-
 
137
        }
-
 
138
 
-
 
139
        if ( m~^=for\s+htmltoc~ )
-
 
140
        {
-
 
141
            $jatsKeyPod = 1;
-
 
142
            last;
-
 
143
        }
-
 
144
    }
-
 
145
 
-
 
146
    close $file;
-
 
147
    return $jatsKeyPod;
-
 
148
}
-
 
149
 
101
1;
150
1;