#!/bin/ksh # create any directories that do not already exist mkdir -p examples/manual/xml # for each chapter, take all the program listings and the outputs # from each, and insert them into an xml file. We'll have one xml file # per chapter which includes all the listings and outputs for that chapter. xmlchapterheading='' magml_path="examples/manual/magml/source" for chapter in text wind contour data obs boxplot using pline do echo "Chapter: $chapter" examples_xml_file="examples/manual/xml/${chapter}_examples.xml" print $xmlchapterheading > $examples_xml_file print "
" >> $examples_xml_file # print " ${chapter} Examples" >> $examples_xml_file for source_file in examples/manual/fortran/source/${chapter}*.f do if [[ ! -a "$source_file" ]] then echo "not found: $source_file" continue fi bname=`basename $source_file .f` echo " Source : $source_file ($bname)" print "" >> $examples_xml_file print "
" >> $examples_xml_file print " Program: $bname" >> $examples_xml_file print " > $examples_xml_file print " xmlns:xi=\"http://www.w3.org/2001/XInclude\" />" >> $examples_xml_file print " " >> $examples_xml_file # if there exists a corresponding MagML example, then include its source too magml_file="$bname.magml" if [[ -a $magml_path/$magml_file ]] then echo " MagML : $magml_file" print "" >> $examples_xml_file print "
" >> $examples_xml_file print " Program: $magml_file" >> $examples_xml_file print " > $examples_xml_file print " xmlns:xi=\"http://www.w3.org/2001/XInclude\" />" >> $examples_xml_file print " " >> $examples_xml_file print "
" >> $examples_xml_file fi for ps_file in examples/manual/fortran/ps/${bname}*.ps do echo " PS : $ps_file" bnameplot=`basename $ps_file .ps` plot_id="${bnameplot}Plot" pngname="examples/manual//fortran/png/$bnameplot.png" # epsname="examples/manual/fortran/epsi/$bnameplot.epsi" pnghtml="images/fortran/$bnameplot.png" print " " >> $examples_xml_file print "
" >> $examples_xml_file print " Plot $bnameplot" >> $examples_xml_file print " " >> $examples_xml_file print " " >> $examples_xml_file print " " >> $examples_xml_file print " " >> $examples_xml_file print " " >> $examples_xml_file print " " >> $examples_xml_file print " " >> $examples_xml_file print " " >> $examples_xml_file print "
" >> $examples_xml_file done print "
" >> $examples_xml_file done print "
" >> $examples_xml_file done # for psfile in examples/ps/*.ps # do # bname=`basename $psfile .ps` # ps2epsi $psfile "examples/epsi/$bname.epsi" # convert $psfile "examples/png/$bname.png" # done