[LON-CAPA-cvs] cvs: doc /help render.texxml.pl texxml2latex.pl loncom/build buildHelp.sh

albertel lon-capa-cvs@mail.lon-capa.org
Tue, 14 Sep 2004 21:18:45 -0000


albertel		Tue Sep 14 17:18:45 2004 EDT

  Modified files:              
    /loncom/build	buildHelp.sh 
    /doc/help	render.texxml.pl texxml2latex.pl 
  Log:
  --with-filenames when running buildHelp.sh will now include the filename or the fragement that causes the particular bit
  
  
Index: loncom/build/buildHelp.sh
diff -u loncom/build/buildHelp.sh:1.5 loncom/build/buildHelp.sh:1.6
--- loncom/build/buildHelp.sh:1.5	Thu Jun  5 09:14:50 2003
+++ loncom/build/buildHelp.sh	Tue Sep 14 17:18:44 2004
@@ -3,8 +3,8 @@
 perl rebuildLabelHash.pl
 
 # build author manual, with the current eps files
-perl render.texxml.pl -- author.manual ../../loncom/html/adm/help/eps/
-perl render.texxml.pl -- course.manual ../../loncom/html/adm/help/eps/
+perl render.texxml.pl -- author.manual  ../../loncom/html/adm/help/eps/ $1
+perl render.texxml.pl -- course.manual  ../../loncom/html/adm/help/eps/ $1
 
 # build on-line access to the manuals
 
Index: doc/help/render.texxml.pl
diff -u doc/help/render.texxml.pl:1.16 doc/help/render.texxml.pl:1.17
--- doc/help/render.texxml.pl:1.16	Tue Sep  2 14:41:11 2003
+++ doc/help/render.texxml.pl	Tue Sep 14 17:18:44 2004
@@ -33,7 +33,7 @@
 {
     print (<<USAGE);
 Usage: $0 texxml_file_name or
-       perl $0 -- texxml_file_name
+       perl $0 -- texxml_file_name [epssource] [--with-filenames]
        where "texxml_file_name" optionally includes the extension
 Output: texxml_file_name.dvi
 
@@ -46,6 +46,12 @@
 
 Must be run as somebody with permissions to write temp files and 
 access /home/httpd/html/adm/help/eps.
+
+If thre is a second argument, it will be used as the path to the 
+eps files, otherwise "../../loncom/html/adm/help/eps" is used.
+
+If the optional argument --with-filenames is included then
+the filename for each fragment is stuck into the finished file.
 USAGE
 
     exit();
@@ -60,19 +66,23 @@
 }
 
 my $epssource = "../../loncom/html/adm/help/eps";
-
-if ( defined ( $ARGV[2] ) ) # override eps source, for build on install
-{
+# override eps source, for build on install
+if ( $ARGV[2] && $ARGV[2] ne '--with-filenames') {
     $epssource = $ARGV[2];
 }
 
+my $include_filenames='';
+if ( $ARGV[2] eq '--with-filenames' || $ARGV[3] eq '--with-filenames') {
+    $include_filenames='--with-filenames';
+}
+
 my $redir = ">& /dev/null"; # empty this for easier debugging
-#my $redir = ">> /home/jerf/error_log.txt";
+#my $redir = ">> /home/albertel/error_log.txt";
 
 mkdir $tmpdir, 0755;
 
 print "Converting texxml to tex...\n";
-if (system ( "perl texxml2latex.pl $fileroot.texxml > $tmpdir/$fileroot.tex" )) {
+if (system ( "perl texxml2latex.pl $fileroot.texxml $include_filenames > $tmpdir/$fileroot.tex" )) {
     $! = 1;
     die "Terminated render because texxml2latex failed; see previous error message.";
 };
Index: doc/help/texxml2latex.pl
diff -u doc/help/texxml2latex.pl:1.9 doc/help/texxml2latex.pl:1.10
--- doc/help/texxml2latex.pl:1.9	Tue Sep  2 14:29:58 2003
+++ doc/help/texxml2latex.pl	Tue Sep 14 17:18:44 2004
@@ -36,6 +36,7 @@
 my $p = HTML::TokeParser->new( $ARGV[0] );
 my $dirprefix = "../../loncom/html/adm/help/tex/";
 
+my $include_filenames = ($ARGV[1] eq '--with-filenames');
 # Make myself a temp dir for processing POD
 my $tmpdir = File::Temp::tempdir('loncapahelpgenXXXXXXX', TMPDIR => 1);
 
@@ -68,6 +69,11 @@
 	    my $file = $attr->{'name'};
 	    open (LATEX_FILE, $dirprefix . $file) or 
 		($! = 1, die "Can't find LaTeX file $dirprefix/$file; terminating build.");
+	    my $esc_file=$file;
+	    $esc_file=~s/_/\\_/g;
+	    if ($include_filenames) {
+		print "\\textrm{File: \\bf $esc_file}\\\\\n";
+	    }
 	    print <LATEX_FILE>;
 	    print "\n\n";
 	}