4
# Copyright 1999-2006 University of Chicago
6
# Licensed under the Apache License, Version 2.0 (the "License");
7
# you may not use this file except in compliance with the License.
8
# You may obtain a copy of the License at
10
# http://www.apache.org/licenses/LICENSE-2.0
12
# Unless required by applicable law or agreed to in writing, software
13
# distributed under the License is distributed on an "AS IS" BASIS,
14
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
# See the License for the specific language governing permissions and
16
# limitations under the License.
22
B<globus-update-doxygen-index> - Replace the share/doc/index.html file
23
with one which contains links to all of the installed package documentation.
27
B<globus-update-doxygen-index> [path to documentation]
31
B<globus-update-doxygen-index> creates an index.html file suitable for
32
browsing all globus-related documentation located in a documentation
33
directory. By default, it builds an index in $GLOBUS_LOCATION/share/doc;
34
an option command line argument should point to a similarly structured
35
directory structure in another location.
39
@GLOBUS_PERL_INITIALIZER@
44
use Grid::GPT::PackageFactory;
48
my %functional_groups = ();
51
my $docpath="$datadir/doc";
59
$output_docpath = $ARGV[1];
62
print "Searching documentation tree $docpath\n";
64
foreach (glob("$docpath/*"))
66
my $nonempty = `wc -l $_/html/*.tag 2> /dev/null`;
72
my $_pkgname = $pkgname;
73
$_pkgname =~ s|-[0-9].*||g;
76
$pkgs{$_pkgname} = $pkgname;
80
print "Sorting into functional groups\n";
81
foreach (keys %pkgs) {
82
my $package_factory = new Grid::GPT::PackageFactory();
83
my @package_files = glob("$datadir/globus/packages/$_/pkg_data*.gpt");
84
my $package_file = $package_files[0];
86
if ($package_file eq '') {
87
print "No package data for $_\n";
90
my $package = $package_factory->type_of_package($package_file);
91
$package->read_metadata_file($package_file);
93
push(@{$functional_groups{$package->{Functional_Group}}}, $_);
94
$descs{$_} = $package->{Description};
97
if ($output_docpath ne '') {
98
$docpath = $output_docpath;
100
my $file = new IO::File(">$docpath/index.html")
101
|| die "unable to write to $docpath/index.html";
106
<title>API Documentation</title>
107
<link href="globus.css" title="Globus" rel="stylesheet" type="text/css">
110
<h1>API Documentation</h1>
114
foreach (keys %functional_groups)
119
print $file "<h2>$_</h2>\n";
121
print $file "<ul>\n";
123
foreach my $pkg (@{$functional_groups{$_}})
126
<li> <a href='$pkgs{$pkg}/html/index.html' target='_top'>$descs{$pkg}</a>
127
[<a href='$pkgs{$pkg}/html/main.html' target='_top'>no frames</a>]
131
print $file "</ul>\n";
135
print $file "</body></html>\n";
139
print "Run the following command to modify the documention for globus.org stylesheets:\n";
140
print "find $docpath -name \"*.html\" -print | xargs sed -i \"s#globus.css#/toolkit/css/c-api.css#\" \n";