No BSD License  

Highlights from
htmltool

htmltool

by

 

The HTML Toolbox (HT) stores various crosslink information about Matlab programs using HTML.

[]=callmak(makernum,idxmaknum,typ)
 function []=callmak(makernum,idxmaknum,typ)
% []=callmak(makernum,idxmaknum,typ)
% Calling the maker*.m file to produce a html file
% for each of the m-files in current directory
%
% INPUT PARAMETERS
%
% makernum          = the number for a makerfile (usually 1)
%                     we assume that all makerfiles have names:
%                     maker1.m, maker2.m, etc.
% idxmaknum         = the number for a IDX_makerfile (usually 1)
%                     i.e. the one making the front index HTML page from where
%                     all the other HTML files are accessed.
%                     we assume that all IDX_makerfiles have names:
%                     IDX_mak1.m, IDX_mak2.m, etc.
% typ               = parameter setting vector
%   typ(1)          = 0->no comment matrix is included.
%                     1->comment matrix included
%   typ(2)          = 0->no reference to loaded files
%                     1->reference to loaded files
%   typ(3)          = 0->no reference to printed files
%                     1->reference to printed files
%   typ(4)          = 0->no reference to saved files
%                     1->reference to saved files
%   typ(5)          = 0->no total cross ref in original m-code
%                     1-> total cross ref in original m-code
%
% Copyright (c) 1996 B.K. Alsberg
%


%warning off


currdir = pwd;
htmldir = [currdir,'\','html'];

index_file = 'index.htm';

disp('Making crosslink matrix')
[C,G2,M] = crossref(currdir);

[n,m]=size(C);

% Removing self-references:
C = C -eye(n);

% Going to the html directory where all
% the files will be generated.


disp('Checking whether HTML exists as a directory');

dirchk = exist('html\nul');

if dirchk ~=2,
 !mkdir html
disp(['You did not have a directory called HTML in ', pwd ,' so I created one.']);
end;

pause(2)

 str = ['cd ',htmldir];
 eval(str);

%%%%%%%%%%%%%  Making the INDEX top node file %%%%%%%%%%%%
%IDX_mak1(index_file,htmldir,G2);
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

makername = ['maker',int2str(makernum)];
idxmaker = ['IDX_mak',int2str(idxmaknum)];
makstr = [idxmaker,'(index_file,htmldir,G2);'];
eval(makstr);

%%%%%%%%%%%%%  Going into each html file %%%%%%%%%%%%%%%%%
for i =1:n
 i

 filename = deblank(G2(i,:))
 ref1 = find(C(i,:)==1);
 ref2 = (find(C(:,i)==1))';
 filename1 = [currdir,'\',filename];
 %%%%%%%%%% Here we use the TYP control vector %%%%%%%%%%%%
 if typ(1) == 1,
  U = com_read(filename1);
 else
  U = [];
 end;

 %%% we have to cut off ".m" extension in filename
 %%% because that is not used in fil_srh.m program

 ff = length(filename1);
 filename2 = filename1(1:ff-2);

 if typ(2) == 1,

   FL = FIL_srh(filename2,1);
 else
   FL = [];
 end;

 if typ(3) == 1,
   FP = FIL_srh(filename2,2);
 else
   FP = [];
 end;

 if typ(4) == 1,
   FS = FIL_srh(filename2,3);
 else
   FS = [];
 end;

 if typ(5) == 1,
   tt = 'yes';
 else
   tt = [];
 end;

 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

 
 % Creating the string matrices containing
 % names to other m-files called or calling
 % current file:
 ref_to = M(ref1,:);
 to_ref = M(ref2,:);
 
 % Just checking that we have a function call at all
 [rowU,colU] = size(U);
 if rowU >0
  funcall = U(1,2:colU);
  if rowU >=2,
   U = U(2:rowU,:);
  else
   U = [];
  end;
 else
  funcall = [];   
 end;



 %%%% The function call to a MAKER file which specifies  %%%%
 %%%% the format used to write out the information about %%%%
 %%%% the m-file.                                        %%%%
 ds =[makername,'(htmldir,currdir,filename,funcall,ref_to,to_ref,U,FL,FP,FS,tt);'];
 eval(ds)
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

 % Popping up to previous directory:
 str = ['cd ..'];
 eval(str);
end;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

str = ['cd ',currdir];
eval(str);








Contact us