


@info:
! @deftypefn {Function File} dynInfo (@var{fun})
! @anchor{dynInfo}
! @sp 1
! Displays internal documentation of matlab/octave routine @var{fun}.m.
! @sp 2
!
! @strong{Inputs}
! @sp 1
! @table @ @var
! @item fun
! string, name of the matlab/octave routine for which internal documentation is needed.
! @end table
! @sp 2
!
! @strong{Outputs}
! @sp 1
! None.
! @sp 2
!
! @strong{This function is called by:}
! @sp 1
! @ref{internals}, @ref{build_internal_documentation}
!
! @strong{This function calls:}
! @sp 1
! @ref{get_internal_doc_block}.
!
! @end deftypefn
@eod:

0001 function dynInfo(fun) 0002 0003 %@info: 0004 %! @deftypefn {Function File} dynInfo (@var{fun}) 0005 %! @anchor{dynInfo} 0006 %! @sp 1 0007 %! Displays internal documentation of matlab/octave routine @var{fun}.m. 0008 %! @sp 2 0009 %! 0010 %! @strong{Inputs} 0011 %! @sp 1 0012 %! @table @ @var 0013 %! @item fun 0014 %! string, name of the matlab/octave routine for which internal documentation is needed. 0015 %! @end table 0016 %! @sp 2 0017 %! 0018 %! @strong{Outputs} 0019 %! @sp 1 0020 %! None. 0021 %! @sp 2 0022 %! 0023 %! @strong{This function is called by:} 0024 %! @sp 1 0025 %! @ref{internals}, @ref{build_internal_documentation} 0026 %! 0027 %! @strong{This function calls:} 0028 %! @sp 1 0029 %! @ref{get_internal_doc_block}. 0030 %! 0031 %! @end deftypefn 0032 %@eod: 0033 0034 % Copyright (C) 2011 Dynare Team 0035 % stephane DOT adjemian AT univ DASH lemans DOT fr 0036 % 0037 % This file is part of Dynare. 0038 % 0039 % Dynare is free software: you can redistribute it and/or modify 0040 % it under the terms of the GNU General Public License as published by 0041 % the Free Software Foundation, either version 3 of the License, or 0042 % (at your option) any later version. 0043 % 0044 % Dynare is distributed in the hope that it will be useful, 0045 % but WITHOUT ANY WARRANTY; without even the implied warranty of 0046 % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 0047 % GNU General Public License for more details. 0048 % 0049 % You should have received a copy of the GNU General Public License 0050 % along with Dynare. If not, see <http://www.gnu.org/licenses/>. 0051 0052 if isempty(strfind(fun,'@')) & (~isempty(strfind(fun,'/')) || ~isempty(strfind(fun,'\')) ) 0053 [pathstr1, name, ext] = fileparts(fun); 0054 addpath(pathstr1); 0055 rm_path = 1; 0056 else 0057 rm_path = 0; 0058 end 0059 0060 [pathstr2, name, ext] = fileparts(which(fun)); 0061 0062 if strcmp(ext(2:end),'m') 0063 block = get_internal_doc_block(name,pathstr2); 0064 if ~isempty(block) 0065 fid = fopen([fun '.texi'],'wt'); 0066 for i=1:size(block,1) 0067 fprintf(fid,'%s\n',deblank(block(i,:))); 0068 end 0069 fclose(fid); 0070 disp(' ') 0071 disp(' ') 0072 system(['makeinfo --plaintext --no-split --no-validate ' fun '.texi']); 0073 delete([fun '.texi']); 0074 else 0075 disp('No documentation for this routine!') 0076 end 0077 else 0078 disp('Not a known matlab/octave routine!') 0079 end 0080 0081 if rm_path 0082 rmpath(pathstr1) 0083 end