# HG changeset patch # User Chris Cannam # Date 1303919721 -3600 # Node ID 675de8e6becfb6612352d6d53e1caac767638982 # Parent a0f6e994657f348e29c48e857ab12122f02bf2bf Tune appearance of MATLAB docs. * use three cols for short index; * add a div to identify the whole output in wider stylesheet context; * avoid showing leading ./ in directory path; * make author file path relative to config file location if relative path provided diff -r a0f6e994657f -r 675de8e6becf extra/soundsoftware/matlab-docs.conf --- a/extra/soundsoftware/matlab-docs.conf Mon Apr 11 20:08:05 2011 +0100 +++ b/extra/soundsoftware/matlab-docs.conf Wed Apr 27 16:55:21 2011 +0100 @@ -35,14 +35,14 @@ # if defined, this text is included at the bottom of the # html files #------------------------------------------------------------------------ -set authorfile = /work/soundsoftware-site/extra/soundsoftware/matlab-docs-credit.html +set authorfile = matlab-docs-credit.html #------------------------------------------------------------------------ # csslink: text for linking to css file (style sheets) # the text defined here is directly included into the head # of the html file #------------------------------------------------------------------------ -set csslink = +#set csslink = #------------------------------------------------------------------------ # links2filescase: this is a bit difficult diff -r a0f6e994657f -r 675de8e6becf extra/soundsoftware/matlab-docs.pl --- a/extra/soundsoftware/matlab-docs.pl Mon Apr 11 20:08:05 2011 +0100 +++ b/extra/soundsoftware/matlab-docs.pl Wed Apr 27 16:55:21 2011 +0100 @@ -224,10 +224,17 @@ # Check the author file if ($var{'authorfile'} ne '') { - if (&CheckFileName($var{'authorfile'}, 'author file')) { - $var{'authorfile'} = ''; - if (!$opt_silent) { print " Proceeding without author information!\n"; } - } + if (!($var{'authorfile'} =~ m,^/,)) { + # relative path: treat as relative to config file + my $cfd = $var{'configfile'}; + $cfd =~ s,/[^/]*$,/,; + $cfd =~ s,^[^/]*$,.,; + $var{'authorfile'} = "$cfd/" . $var{'authorfile'}; + } + if (&CheckFileName($var{'authorfile'}, 'author file')) { + $var{'authorfile'} = ''; + if (!$opt_silent) { print " Proceeding without author information!\n"; } + } } # Call the function doing all the real work @@ -696,6 +703,7 @@ print IFILE "\n"; print IFILE "\n"; + print IFILE "
\n"; if ($var{'textheaderindexalldirs'} eq '') { print IFILE "

Index of Directories of $var{'dirmfiles'}

\n"; } else { @@ -757,7 +765,7 @@ print IFILE "\n"; print IFILE "\n"; - print IFILE "\n\n"; + print IFILE "
\n\n\n"; close(IFILE); @@ -814,11 +822,14 @@ # Write the header of HTML file print IFILE "$TextDocTypeHTML\n\n\n$var{'codeheadmeta'}\n$TextMetaCharset\n$var{'csslink'}\n"; + my $dirToPrint = $LocalActDir; + $dirToPrint =~ s,^./,,; + if ($var{'texttitleindex'} eq '') { - print IFILE "Index of Matlab Files in Directory $LocalActDir\n"; + print IFILE "Index of Matlab Files in Directory $dirToPrint\n"; } else { if ($LocalGlobalLocal eq 'global') { print IFILE "$var{'texttitleindex'}\n"; } - else { print IFILE "$var{'texttitleindex'} in Directory $LocalActDir\n"; } + else { print IFILE "$var{'texttitleindex'} in Directory $dirToPrint\n"; } } if ($var{'frames'} eq 'yes') { @@ -827,11 +838,12 @@ print IFILE "\n"; print IFILE "\n"; + print IFILE "
\n"; if ($var{'textheaderindex'} eq '') { - print IFILE "

Index of Matlab Files in Directory $LocalActDir

\n"; + print IFILE "

Index of Matlab Files in Directory $dirToPrint

\n"; } else { if ($LocalGlobalLocal eq 'global') { print IFILE "

$var{'textheaderindex'}

\n"; } - else { print IFILE "

$var{'textheaderindex'} in Directory $LocalActDir

\n"; } + else { print IFILE "

$var{'textheaderindex'} in Directory $dirToPrint

\n"; } } # include links to indexes @@ -856,29 +868,44 @@ for('a'..'z') { # print " $_: @{$_}\n"; $numberofletter = $#{$_}+1; + $cols = 3; if ($numberofletter > 0) { - print IFILE "\n
\U$_\E\n"; - $numberhalf = ($numberofletter + 1 - (($numberofletter+1) % 2))/2; - if ($debug > 2) { print " $_: @{$_} \t $numberhalf \t $numberofletter\n"; } - for($count = 0; $count < $numberhalf; $count++) { - $name = @{$_}[$count]; - if ($LocalGlobalLocal eq 'global') { $dirpath = $hfilerelpath{$name}; } else { $dirpath = ""; } - print IFILE "$mfilename{$name}"; - if (($count + $numberhalf) < $numberofletter) { - $name = @{$_}[$count + $numberhalf]; - if ($LocalGlobalLocal eq 'global') { $dirpath = $hfilerelpath{$name}; } else { $dirpath = ""; } - print IFILE "$mfilename{$name}\n"; - } else { - print IFILE "\n"; - } - } + print IFILE "\n
\U$_\E\n"; + for ($count = 0; $count < $numberofletter; $count++) { + if (($count % $cols) == 0) { + if ($count > 0) { + print IFILE "\n"; + } + print IFILE ""; + } + $name = @{$_}[$count]; + if ($LocalGlobalLocal eq 'global') { $dirpath = $hfilerelpath{$name}; } else { $dirpath = ""; } + print IFILE "$mfilename{$name}"; + } + + print IFILE "\n"; + + # $numberhalf = ($numberofletter + 1 - (($numberofletter+1) % 2))/2; + # if ($debug > 2) { print " $_: @{$_} \t $numberhalf \t $numberofletter\n"; } + # for($count = 0; $count < $numberhalf; $count++) { + # $name = @{$_}[$count]; + # if ($LocalGlobalLocal eq 'global') { $dirpath = $hfilerelpath{$name}; } else { $dirpath = ""; } + # print IFILE "$mfilename{$name}"; + # if (($count + $numberhalf) < $numberofletter) { + # $name = @{$_}[$count + $numberhalf]; + # if ($LocalGlobalLocal eq 'global') { $dirpath = $hfilerelpath{$name}; } else { $dirpath = ""; } + # print IFILE "$mfilename{$name}\n"; + # } else { + # print IFILE "\n"; + # } + # } } } print IFILE "\n
$var{'codehr'}\n"; } elsif ($LocalShortLong eq 'long') { # begin create long index - print IFILE "\n"; + print IFILE "
\n"; print IFILE "\n"; for('a'..'z') { @@ -904,7 +931,7 @@ print IFILE "\n"; print IFILE "\n"; - print IFILE "\n\n"; + print IFILE "\n\n\n"; close(IFILE); @@ -928,10 +955,10 @@ print IFILE "$TextDocTypeHTML\n\n\n$var{'codeheadmeta'}\n$TextMetaCharset\n$var{'csslink'}\n"; if ($var{'texttitleindex'} eq '') { - print IFILE "A-Z jump index in directory $LocalActDir\n"; + print IFILE "A-Z jump index in directory $dirToPrint\n"; } else { if ($LocalGlobalLocal eq 'global') { print IFILE "$var{'texttitleindex'}\n"; } - else { print IFILE "$var{'texttitleindex'} in Directory $LocalActDir\n"; } + else { print IFILE "$var{'texttitleindex'} in Directory $dirToPrint\n"; } } if ($var{'frames'} eq 'yes') { @@ -939,6 +966,7 @@ } print IFILE "\n"; print IFILE "\n"; + print IFILE "
\n"; # Write the A-Z jump line, generate link for letters with files starting with this letter # and only letters for no files starting with this letter @@ -952,7 +980,7 @@ } } - print IFILE "\n\n"; + print IFILE "
\n\n"; close(IFILE); @@ -979,10 +1007,10 @@ print IFILE "$TextDocTypeHTML\n\n\n$var{'codeheadmeta'}\n$TextMetaCharset\n$var{'csslink'}\n"; if ($var{'texttitleindex'} eq '') { - print IFILE "Index of Matlab Files in Directory $LocalActDir\n"; + print IFILE "Index of Matlab Files in Directory $dirToPrint\n"; } else { if ($LocalGlobalLocal eq 'global') { print IFILE "$var{'texttitleindex'}\n"; } - else { print IFILE "$var{'texttitleindex'} in Directory $LocalActDir\n"; } + else { print IFILE "$var{'texttitleindex'} in Directory $dirToPrint\n"; } } print IFILE "\n"; @@ -1217,11 +1245,11 @@ # Write Title and start body of html-file print HFILE "$var{'texttitlefiles'} $mfilename{$name}\n\n"; print HFILE "\n"; + print HFILE "
\n"; print HFILE "

$var{'textheaderfiles'} $mfilename{$name}

\n"; # http://test.soundsoftware.ac.uk/cannam/projects/smallbox/repository/annotate/DL/RLS-DLA/SolveFISTA.m - - print HFILE "View in repository\n"; +# print HFILE "View in repository\n"; print HFILE "$var{'codehr'}\n"; @@ -1330,7 +1358,7 @@ print HFILE "\n"; print HFILE "\n"; - print HFILE "\n\n"; + print HFILE "
\n\n\n"; close(MFILE); close(HFILE); diff -r a0f6e994657f -r 675de8e6becf public/themes/soundsoftware/stylesheets/application.css --- a/public/themes/soundsoftware/stylesheets/application.css Mon Apr 11 20:08:05 2011 +0100 +++ b/public/themes/soundsoftware/stylesheets/application.css Wed Apr 27 16:55:21 2011 +0100 @@ -230,5 +230,9 @@ .embedded .contents .center { text-align: center; } /* undo javadoc hack above */ +/* For MATLAB documentation */ +.embedded #matlabdoc th { text-align: left; } + +
NameSynopsis