Home > external > updateDocumentation.m

updateDocumentation

PURPOSE ^

updateDocumentation

SYNOPSIS ^

function updateDocumentation()

DESCRIPTION ^

 updateDocumentation
    Updates HTML documentation files for all RAVEN functions. It should
    only be used when preparing `develop` branch for a new RAVEN release

    Usage: updateDocumentation()

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function updateDocumentation()
0002 % updateDocumentation
0003 %    Updates HTML documentation files for all RAVEN functions. It should
0004 %    only be used when preparing `develop` branch for a new RAVEN release
0005 %
0006 %    Usage: updateDocumentation()
0007 
0008 %Get the RAVEN path
0009 ravenDir=findRAVENroot();
0010 %Make sure that RAVEN-provided m2html is used
0011 path(fullfile(ravenDir,'software','m2html'),path);
0012 %Get a non-redundant list of RAVEN subdirectories containing MATLAB
0013 %functions. Absolute paths are not compatible with M2HTML, so convert them
0014 %to the relative paths instead.
0015 ravenDirs=dir(fullfile(ravenDir,'**/*.m'));
0016 ravenDirs=unique({ravenDirs.folder})';
0017 
0018 %Get rid of MATLAB functions from external software
0019 ravenDirs(startsWith(ravenDirs,strcat(ravenDir,filesep,'software')))=[];
0020 ravenDirs(startsWith(ravenDirs,strcat(ravenDir,filesep,'legacy',filesep,'software')))=[];
0021 
0022 %Remove keggModel.mat if it exists
0023 if exist(fullfile(ravenDir,'external','kegg','keggModel.mat'), 'file') == 2
0024     delete(fullfile(ravenDir,'external','kegg','keggModel.mat'));
0025 end
0026 
0027 %Remove existing "doc" directory from RAVEN
0028 rmdir(fullfile(ravenDir,'doc'),'s');
0029 
0030 %Make relative path
0031 relStart = numel(ravenDir)+2;
0032 for i=1:numel(ravenDirs)
0033     ravenDirs{i,1} = ravenDirs{i,1}(relStart:end);
0034 end
0035 
0036 %Save the current working directory and go to RAVEN root directory
0037 originalDir=pwd;
0038 cd(ravenDir);
0039 %Generate HTML documentation files for RAVEN MATLAB functions
0040 m2html('mFiles',ravenDirs,'htmldir','doc');
0041 %Go back to the original working directory
0042 cd(originalDir);
0043 
0044 end

Generated by m2html © 2005