Changeset 29 for prextra/prcontent2html.m
- Timestamp:
- 03/31/12 18:05:01 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
prextra/prcontent2html.m
r14 r29 1 1 %PRCONTENT2HTML Construct HTML file from PRTools Contents file 2 2 % 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 6 function out = prcontent2html(name,recreate,htmldir) 7 8 if nargin < 3, htmldir = cd; end 9 if nargin < 2 | isempty(recreate), recreate = 0; end 9 10 10 11 if exist([name '/Contents.m']) == 2 … … 63 64 pp = fileparts(file); 64 65 [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>']; 66 67 s = [s '<td>' posttok '</td></tr>']; 67 68 end … … 69 70 s = [s '</table>']; 70 71 s = [s '</p></body></html>']; 71 writf([ name'.html'],s);72 writf([fullfile(htmldir,name) '.html'],s); 72 73 if nargout > 0 73 74 out = s; … … 130 131 return 131 132 132 function s = commandrefs(r,recreate,subdir )133 function s = commandrefs(r,recreate,subdir,htmldir) 133 134 if nargin < 2, recreate = 0; end 134 135 if regexp(r,'^ *$') … … 143 144 end 144 145 145 if exist( htmlname,'file') == 2146 if exist(fullfile(htmldir,htmlname),'file') == 2 146 147 s = [s '<a href="' htmlname '">' tok '</a>, ']; 147 148 elseif isempty(tok) | regexp(tok,'^ *')
Note: See TracChangeset
for help on using the changeset viewer.