summaryrefslogtreecommitdiff
path: root/lib/sbin/ThornGuide.pl
diff options
context:
space:
mode:
authorallen <allen@17b73243-c579-4c4c-a9d2-2d5706c11dac>2001-04-28 06:51:56 +0000
committerallen <allen@17b73243-c579-4c4c-a9d2-2d5706c11dac>2001-04-28 06:51:56 +0000
commit6dc54795998dad4d03d95dd1fc57517458e001d7 (patch)
tree406c40c8f684ac5acf3abe10018b09a1eefdb237 /lib/sbin/ThornGuide.pl
parenta1d6e94c681d4015e2c42ea7bfc12e0725478437 (diff)
Integrating the documentation created from the param.ccl files in each thorn
into the ThornGuide. git-svn-id: http://svn.cactuscode.org/flesh/trunk@2136 17b73243-c579-4c4c-a9d2-2d5706c11dac
Diffstat (limited to 'lib/sbin/ThornGuide.pl')
-rw-r--r--lib/sbin/ThornGuide.pl42
1 files changed, 27 insertions, 15 deletions
diff --git a/lib/sbin/ThornGuide.pl b/lib/sbin/ThornGuide.pl
index 7d46173d..0d0d0a7a 100644
--- a/lib/sbin/ThornGuide.pl
+++ b/lib/sbin/ThornGuide.pl
@@ -128,7 +128,7 @@ foreach (@foundfiles)
$arrangements{$arr} = $1;
}
push @$arr, $thorn; # hash of arrangements & thorns
- print STDERR "\nFound: $_" if ($verbose);
+ # print STDERR "\nFound: $_" if ($verbose);
}
# #
##############################################################
@@ -199,13 +199,13 @@ sub Read_Thorn_Doc
$pathandfile .= "/$file";
- open (DOC, "$pathandfile") || print STDERR "\ncannot open $pathandfile: $!";
+ open (DOC, "$pathandfile");
while (<DOC>) # loop through thorn doc.
{
if (/\\end\{document\}/) { # stop reading
$stop = 1;
- $contents .= "\n\\include{${thorn}_par}\n";
+ $contents .= "\n\\include{${arrangement}_${thorn}_par}\n";
}
if ($start && ! $stop) { # add to $contents
@@ -223,7 +223,14 @@ sub Read_Thorn_Doc
# if it never started reading, then we print some error message
if (! $start) {
- $contents = "Could not parse/find latex documentation ($file)";
+ $tmp = $thorn;
+ $tmp=~ s/\_/\\\_/g;
+ if (-e $pathandfile) {
+ $contents = "Could not parse latex documentation for $arrangement/$tmp($file)";
+ } else {
+ $contents = "Could not find latex documentation for $arrangement/$tmp ($file)";
+ }
+ $contents .= "\n\n\\include{${arrangement}\_${thorn}\_par}\n";
}
close DOC;
@@ -240,6 +247,7 @@ sub Add_Section
my ($thorn) = shift;
my ($contents) = shift;
+$thorn =~ s/\_/\\\_/g;
print OUT <<EOC;
\\chapter{$thorn}
@@ -314,11 +322,11 @@ sub Read_ThornList
foreach $tempvar (@temp) # see if docs exist for these thorns
{
- if (-e "$directory$tempvar/doc/$file") {
+# if (-e "$directory$tempvar/doc/$file") {
push @tl, "$directory$tempvar/doc/$file";
- } else {
- print "\nCannot find: $tempvar/doc/$file" if ($verbose);
- }
+# } else {
+# print "\nCannot find: $tempvar/doc/$file" if ($verbose);
+# }
}
return @tl;
@@ -332,7 +340,7 @@ sub Recur
local ($dir) = shift;
local (@dirs);
- chdir ($dir) || die "cannot chdir to $dir: $!";
+ chdir ($dir) || die "\nFatal Error: cannot chdir to $dir: $!";
open (LS, "ls -p|");
@@ -344,13 +352,17 @@ sub Recur
}
close (LS);
- if (-e "$file") { # we found the file
- push @foundfiles, $dir;
- } elsif ($dir =~ /doc\/$/) { # we didn't find the file
- print STDERR "\n$dir\t\tNo $file" if ($verbose);
- push @foundfiles, $dir;
+ if ($dir =~ /arrangements\/(.*?)\/(.*?)\/$/) {
+ if (-e "${dir}/doc/$file") { # we found the file
+ push @foundfiles, $dir;
+ print STDERR "\n$dir\t\tFound $file" if ($verbose);
+ } elsif (-e "${dir}param.ccl") { # we didn't find the file
+ print STDERR "\n$dir\t\tNo $file, but param.ccl" if ($verbose);
+ push @foundfiles, "${dir}/doc";
+ } else {
+ #print STDERR "\n$dir\t\tNo $file, no param.ccl" if ($verbose);
+ }
}
-
foreach (@dirs) { # look in sub directories
&Recur("$dir$_");
}