summaryrefslogtreecommitdiff
path: root/lib/sbin/ThornGuide.pl
diff options
context:
space:
mode:
authorikelley <ikelley@17b73243-c579-4c4c-a9d2-2d5706c11dac>2002-05-05 10:18:11 +0000
committerikelley <ikelley@17b73243-c579-4c4c-a9d2-2d5706c11dac>2002-05-05 10:18:11 +0000
commit4745eeac314f4a4602611ec72cdebe68002820a9 (patch)
tree76bdbffdc98107281bd789c0d2aa1dfc9cdf280e /lib/sbin/ThornGuide.pl
parent5f610f8e1e7bf01825b661a40dba03dfd97b301c (diff)
trying to get author name, title, etc.
git-svn-id: http://svn.cactuscode.org/flesh/trunk@2786 17b73243-c579-4c4c-a9d2-2d5706c11dac
Diffstat (limited to 'lib/sbin/ThornGuide.pl')
-rw-r--r--lib/sbin/ThornGuide.pl26
1 files changed, 23 insertions, 3 deletions
diff --git a/lib/sbin/ThornGuide.pl b/lib/sbin/ThornGuide.pl
index a2322a2b..e1c9b8fa 100644
--- a/lib/sbin/ThornGuide.pl
+++ b/lib/sbin/ThornGuide.pl
@@ -68,8 +68,15 @@ my $file = "documentation.tex";
# specify output file
$outfile ||= "ThornGuide.tex";
+my $configname = "";
+
+if ($outfile =~ /ThornGuide\-?(.*?)\.tex/) {
+ $configname = ": $1";
+}
+
# get the date for printing out on the first page of the documentation
my $TODAYS_DATE = `date +%B%d%Y`;
+chomp $TODAYS_DATE;
$TODAYS_DATE =~ s/(.*?)(\d{2})(\d{4})/$1 $2, $3/;
# set some variables in ThornUtils(.pm) namespace
@@ -161,11 +168,19 @@ sub Read_Thorn_Doc
my $path = "$arrangements_dir$arrangement/$thorn/doc";
my $pathandfile = "$path/$file";
+
+ my $title = "";
+ my $author = "";
+ my $date = "";
open (DOC, "<$pathandfile") || print STDERR "\nCould not find documentation in $path";
while (<DOC>) # loop through thorn doc.
{
+ if (/\\title\{(.*?)\}/) { $title = $1; }
+ if (/\\author\{(.*?)\}/) { $author = $1; }
+ if (/\\date\{(.*?)\}/) { $date = $1; }
+
if (/\\end\{document\}/) { # stop reading
$stop = 1;
$contents .= "\n\\include{${arrangement}_${thorn}_param}\n";
@@ -207,7 +222,13 @@ sub Read_Thorn_Doc
close DOC;
- return $contents;
+ my $cnts = "";
+ $cnts .= "\n\"$title\"\n" if ($title =~ /\w/) && (lc($title) ne lc($thorn));
+ $cnts .= "\n\{\\bf Author(s):\} $author\n" if ($author =~ /\w/);
+ $cnts .= "\n\{\\bf Date:\} $date\n" if ($date =~ /\w/);
+ $cnts .= "\n\\minitoc";
+
+ return "$cnts\n$contents";
}
#/*@@
@@ -229,7 +250,6 @@ $thorn = ThornUtils::CleanForLatex($thorn);
print OUT <<EOC;
\\chapter{$thorn}
-\\minitoc
$contents
EOC
@@ -451,7 +471,7 @@ print OUT <<EOC;
\\begin{document}
-\\cactustitlepage{Thorn Guide}{Date of Creation:}{$TODAYS_DATE}
+\\cactustitlepage{Thorn Guide$configname}{Date of Creation:}{$TODAYS_DATE}
\\dominitoc
\\setcounter{page}{1}