Revision 410:675de8e6becf extra/soundsoftware

View differences:

extra/soundsoftware/matlab-docs.conf
35 35
#               if defined, this text is included at the bottom of the 
36 36
#               html files
37 37
#------------------------------------------------------------------------
38
set authorfile = /work/soundsoftware-site/extra/soundsoftware/matlab-docs-credit.html
38
set authorfile = matlab-docs-credit.html
39 39

  
40 40
#------------------------------------------------------------------------
41 41
# csslink:   text for linking to css file (style sheets)
42 42
#            the text defined here is directly included into the head 
43 43
#            of the html file
44 44
#------------------------------------------------------------------------
45
set csslink = <link rel=stylesheet type="text/css" href="CSSFILENAME.css" />
45
#set csslink = <link rel=stylesheet type="text/css" href="CSSFILENAME.css" />
46 46

  
47 47
#------------------------------------------------------------------------
48 48
# links2filescase: this is a bit difficult
extra/soundsoftware/matlab-docs.pl
224 224

  
225 225
# Check the author file
226 226
if ($var{'authorfile'} ne '') {
227
   if (&CheckFileName($var{'authorfile'}, 'author file')) {
228
      $var{'authorfile'} = '';
229
      if (!$opt_silent) { print "   Proceeding without author information!\n"; }
230
   }
227
    if (!($var{'authorfile'} =~ m,^/,)) {
228
	# relative path: treat as relative to config file
229
	my $cfd = $var{'configfile'};
230
	$cfd =~ s,/[^/]*$,/,;
231
	$cfd =~ s,^[^/]*$,.,;
232
	$var{'authorfile'} = "$cfd/" . $var{'authorfile'};
233
    }
234
    if (&CheckFileName($var{'authorfile'}, 'author file')) {
235
	$var{'authorfile'} = '';
236
	if (!$opt_silent) { print "   Proceeding without author information!\n"; }
237
    }
231 238
}
232 239

  
233 240
# Call the function doing all the real work
......
696 703

  
697 704
      print IFILE "</head>\n";
698 705
      print IFILE "<body $var{'codebodyindex'}>\n";
706
      print IFILE "<div id=\"matlabdoc\">\n";
699 707
      if ($var{'textheaderindexalldirs'} eq '') {
700 708
         print IFILE "<h1 $var{'codeheader'}>Index of Directories of <em>$var{'dirmfiles'}</em></h1>\n";
701 709
      } else {
......
757 765

  
758 766
      print IFILE "<!--navigate-->\n";
759 767
      print IFILE "<!--copyright-->\n";
760
      print IFILE "</body>\n</html>\n";
768
      print IFILE "</div>\n</body>\n</html>\n";
761 769

  
762 770
      close(IFILE);
763 771

  
......
814 822
   # Write the header of HTML file
815 823
   print IFILE "$TextDocTypeHTML\n<html>\n<head>\n$var{'codeheadmeta'}\n$TextMetaCharset\n$var{'csslink'}\n";
816 824
   
825
   my $dirToPrint = $LocalActDir;
826
   $dirToPrint =~ s,^./,,;
827

  
817 828
   if ($var{'texttitleindex'} eq '') {
818
      print IFILE "<title>Index of Matlab Files in Directory $LocalActDir</title>\n";
829
      print IFILE "<title>Index of Matlab Files in Directory $dirToPrint</title>\n";
819 830
   } else {
820 831
      if ($LocalGlobalLocal eq 'global') { print IFILE "<title>$var{'texttitleindex'}</title>\n"; }
821
      else { print IFILE "<title>$var{'texttitleindex'} in Directory $LocalActDir</title>\n"; }
832
      else { print IFILE "<title>$var{'texttitleindex'} in Directory $dirToPrint</title>\n"; }
822 833
   }
823 834

  
824 835
   if ($var{'frames'} eq 'yes') {
......
827 838
   print IFILE "</head>\n";
828 839

  
829 840
   print IFILE "<body $var{'codebodyindex'}>\n";
841
   print IFILE "<div id=\"matlabdoc\">\n";
830 842
   if ($var{'textheaderindex'} eq '') {
831
      print IFILE "<h1 $var{'codeheader'}>Index of Matlab Files in Directory $LocalActDir</h1>\n";
843
      print IFILE "<h1 $var{'codeheader'}>Index of Matlab Files in Directory $dirToPrint</h1>\n";
832 844
   } else {
833 845
      if ($LocalGlobalLocal eq 'global') { print IFILE "<h1 $var{'codeheader'}>$var{'textheaderindex'}</h1>\n"; }
834
      else { print IFILE "<h1 $var{'codeheader'}>$var{'textheaderindex'} in Directory $LocalActDir</h1>\n"; }
846
      else { print IFILE "<h1 $var{'codeheader'}>$var{'textheaderindex'} in Directory $dirToPrint</h1>\n"; }
835 847
   }
836 848

  
837 849
   # include links to indexes
......
856 868
      for('a'..'z') {
857 869
         # print "   $_: @{$_}\n";
858 870
         $numberofletter = $#{$_}+1;
871
	 $cols = 3;
859 872
         if ($numberofletter > 0) {
860
            print IFILE "\n<tr><td colspan=\"2\"><br /><strong><a name=\"\U$_\E$_\"></a><span class=\"an\">\U$_\E</span></strong></td></tr>\n";
861
            $numberhalf = ($numberofletter + 1 - (($numberofletter+1) % 2))/2;
862
            if ($debug > 2) { print "   $_: @{$_} \t $numberhalf \t $numberofletter\n"; }
863
            for($count = 0; $count < $numberhalf; $count++) {
864
               $name = @{$_}[$count];
865
               if ($LocalGlobalLocal eq 'global') { $dirpath = $hfilerelpath{$name}; } else { $dirpath = ""; }
866
               print IFILE "<tr><td width=\"50%\"><a href=\"$dirpath$mfilename{$name}$var{'exthtml'}\">$mfilename{$name}</a></td>";
867
               if (($count + $numberhalf) < $numberofletter) {
868
                  $name = @{$_}[$count + $numberhalf];
869
                  if ($LocalGlobalLocal eq 'global') { $dirpath = $hfilerelpath{$name}; } else { $dirpath = ""; }
870
                  print IFILE "<td width=\"50%\"><a href=\"$dirpath$mfilename{$name}$var{'exthtml'}\">$mfilename{$name}</a></td></tr>\n";
871
               } else {
872
                  print IFILE "<td width=\"50%\"></td></tr>\n";
873
               }
874
            }
873
            print IFILE "\n<tr><td><br/><strong><a name=\"\U$_\E$_\"></a><span class=\"an\">\U$_\E</span></strong></td></tr>\n";
874
            for ($count = 0; $count < $numberofletter; $count++) {
875
		if (($count % $cols) == 0) {
876
		    if ($count > 0) {
877
			print IFILE "</tr><tr>\n";
878
		    }
879
		    print IFILE "<tr><td></td>";
880
		}
881
		$name = @{$_}[$count];
882
		if ($LocalGlobalLocal eq 'global') { $dirpath = $hfilerelpath{$name}; } else { $dirpath = ""; }
883
		print IFILE "<td><a href=\"$dirpath$mfilename{$name}$var{'exthtml'}\">$mfilename{$name}</a></td>";
884
	    }
885

  
886
	    print IFILE "</tr>\n";
887
		    
888
            # $numberhalf = ($numberofletter + 1 - (($numberofletter+1) % 2))/2;
889
            # if ($debug > 2) { print "   $_: @{$_} \t $numberhalf \t $numberofletter\n"; }
890
            # for($count = 0; $count < $numberhalf; $count++) {
891
            #    $name = @{$_}[$count];
892
            #    if ($LocalGlobalLocal eq 'global') { $dirpath = $hfilerelpath{$name}; } else { $dirpath = ""; }
893
            #    print IFILE "<tr><td width=\"50%\"><a href=\"$dirpath$mfilename{$name}$var{'exthtml'}\">$mfilename{$name}</a></td>";
894
            #    if (($count + $numberhalf) < $numberofletter) {
895
            #       $name = @{$_}[$count + $numberhalf];
896
            #       if ($LocalGlobalLocal eq 'global') { $dirpath = $hfilerelpath{$name}; } else { $dirpath = ""; }
897
            #       print IFILE "<td width=\"50%\"><a href=\"$dirpath$mfilename{$name}$var{'exthtml'}\">$mfilename{$name}</a></td></tr>\n";
898
            #    } else {
899
            #       print IFILE "<td width=\"50%\"></td></tr>\n";
900
            #    }
901
            # }
875 902
         }
876 903
      }
877 904
      print IFILE "</table>\n<br />$var{'codehr'}\n";
878 905

  
879 906
   } elsif ($LocalShortLong eq 'long') {
880 907
      # begin create long index
881
      print IFILE "<table border=\"5\" width=\"100%\" cellpadding=\"5\">\n";
908
      print IFILE "<table width=\"100%\">\n";
882 909
      print IFILE "<tr><th>Name</th><th>Synopsis</th></tr>\n";
883 910

  
884 911
      for('a'..'z') {
......
904 931

  
905 932
   print IFILE "<!--navigate-->\n";
906 933
   print IFILE "<!--copyright-->\n";
907
   print IFILE "</body>\n</html>\n";
934
   print IFILE "</div>\n</body>\n</html>\n";
908 935

  
909 936
   close(IFILE);
910 937

  
......
928 955
       print IFILE "$TextDocTypeHTML\n<html>\n<head>\n$var{'codeheadmeta'}\n$TextMetaCharset\n$var{'csslink'}\n";
929 956
       
930 957
       if ($var{'texttitleindex'} eq '') {
931
	   print IFILE "<title>A-Z jump index in directory $LocalActDir</title>\n";
958
	   print IFILE "<title>A-Z jump index in directory $dirToPrint</title>\n";
932 959
       } else {
933 960
	   if ($LocalGlobalLocal eq 'global') { print IFILE "<title>$var{'texttitleindex'}</title>\n"; }
934
	   else { print IFILE "<title>$var{'texttitleindex'} in Directory $LocalActDir</title>\n"; }
961
	   else { print IFILE "<title>$var{'texttitleindex'} in Directory $dirToPrint</title>\n"; }
935 962
       }
936 963

  
937 964
       if ($var{'frames'} eq 'yes') {
......
939 966
       }
940 967
       print IFILE "</head>\n";
941 968
       print IFILE "<body $var{'codebodyindex'}>\n";
969
       print IFILE "<div id=\"matlabdoc\">\n";
942 970

  
943 971
       # Write the A-Z jump line, generate link for letters with files starting with this letter
944 972
       # and only letters for no files starting with this letter
......
952 980
	   }
953 981
       }
954 982

  
955
       print IFILE "</body>\n</html>\n";
983
       print IFILE "</div></body>\n</html>\n";
956 984

  
957 985
       close(IFILE);
958 986

  
......
979 1007
       print IFILE "$TextDocTypeHTML\n<html>\n<head>\n$var{'codeheadmeta'}\n$TextMetaCharset\n$var{'csslink'}\n";
980 1008

  
981 1009
       if ($var{'texttitleindex'} eq '') {
982
	   print IFILE "<title>Index of Matlab Files in Directory $LocalActDir</title>\n";
1010
	   print IFILE "<title>Index of Matlab Files in Directory $dirToPrint</title>\n";
983 1011
       } else {
984 1012
	   if ($LocalGlobalLocal eq 'global') { print IFILE "<title>$var{'texttitleindex'}</title>\n"; }
985
	   else { print IFILE "<title>$var{'texttitleindex'} in Directory $LocalActDir</title>\n"; }
1013
	   else { print IFILE "<title>$var{'texttitleindex'} in Directory $dirToPrint</title>\n"; }
986 1014
       }
987 1015
       print IFILE "</head>\n";
988 1016

  
......
1217 1245
      # Write Title and start body of html-file
1218 1246
      print HFILE "<title>$var{'texttitlefiles'} $mfilename{$name}</title>\n</head>\n";
1219 1247
      print HFILE "<body $var{'codebodyfiles'}>\n";
1248
      print HFILE "<div id=\"matlabdoc\">\n";
1220 1249
      print HFILE "<h1 $var{'codeheader'}>$var{'textheaderfiles'} $mfilename{$name}</h1>\n";
1221 1250

  
1222 1251
# http://test.soundsoftware.ac.uk/cannam/projects/smallbox/repository/annotate/DL/RLS-DLA/SolveFISTA.m
1223

  
1224
      print HFILE "<a href=\"" . $hfileindexpath{$name} . "../../projects/smallbox/repository/annotate/" . $mfiledir{$name}  . $mfilename{$name} . ".m\">View in repository</a>\n";
1252
#      print HFILE "<a href=\"" . $hfileindexpath{$name} . "../../projects/smallbox/repository/annotate/" . $mfiledir{$name}  . $mfilename{$name} . ".m\">View in repository</a>\n";
1225 1253

  
1226 1254
      print HFILE "$var{'codehr'}\n";
1227 1255

  
......
1330 1358

  
1331 1359
      print HFILE "<!--navigate-->\n";
1332 1360
      print HFILE "<!--copyright-->\n";
1333
      print HFILE "</body>\n</html>\n";
1361
      print HFILE "</div>\n</body>\n</html>\n";
1334 1362
      close(MFILE);
1335 1363
      close(HFILE);
1336 1364

  

Also available in: Unified diff