Ignore:
Timestamp:
03/31/12 18:05:01 (13 years ago)
Author:
bduin
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • prextra/prcontent2html.m

    r14 r29  
    11%PRCONTENT2HTML Construct HTML file from PRTools Contents file
    22%
    3 %               PRCONTENT2HTML(NAME,RECREATE)
    4 
    5 
    6 function out = prcontent2html(name,recreate)
    7 
    8 if nargin < 2, recreate = 0; end
     3%               PRCONTENT2HTML(NAME,RECREATE,HTMLDIR)
     4
     5
     6function out = prcontent2html(name,recreate,htmldir)
     7
     8if nargin < 3, htmldir = cd; end
     9if nargin < 2 | isempty(recreate), recreate = 0; end
    910
    1011if exist([name '/Contents.m']) == 2
     
    6364                pp = fileparts(file);
    6465                [pp2,subdir] = fileparts(pp);
    65                 s = [s '<tr> <td width="100" valign="top">' commandrefs(tok,recreate,subdir) '</td>'];
     66                s = [s '<tr> <td width="100" valign="top">' commandrefs(tok,recreate,subdir,htmldir) '</td>'];
    6667                s = [s '<td>' posttok '</td></tr>'];
    6768        end
     
    6970s = [s '</table>'];
    7071s = [s '</p></body></html>'];
    71 writf([name '.html'],s);
     72writf([fullfile(htmldir,name) '.html'],s);
    7273if nargout > 0
    7374        out = s;
     
    130131return
    131132
    132 function s = commandrefs(r,recreate,subdir)
     133function s = commandrefs(r,recreate,subdir,htmldir)
    133134        if nargin < 2, recreate = 0; end
    134135        if regexp(r,'^ *$')
     
    143144        end
    144145       
    145         if exist(htmlname,'file') == 2
     146        if exist(fullfile(htmldir,htmlname),'file') == 2
    146147                s = [s '<a href="' htmlname '">' tok '</a>, '];
    147148        elseif isempty(tok) | regexp(tok,'^ *')
Note: See TracChangeset for help on using the changeset viewer.