|
1 | 1 | function helpStr = getFormatedRef( file ,varargin)
|
2 | 2 | % returns a processed string for function file
|
3 | 3 | %
|
4 |
| -%% Input |
| 4 | +% Input |
5 | 5 | % file - current file
|
6 | 6 | %
|
7 |
| -%% Output |
| 7 | +% Output |
8 | 8 | % helpString - a string for publishing
|
9 | 9 | %
|
10 |
| -%% Remarks !TODO |
| 10 | +% Remarks !TODO |
11 | 11 | % 'input', 'output', 'example', 'see also', 'description', 'syntax', 'view code'
|
12 | 12 | %
|
13 |
| -%% See also |
| 13 | +% See also |
14 | 14 | % DocFile/getFormatedDoc DocFile/publish
|
15 | 15 |
|
16 | 16 | options = parseArguments(varargin);
|
|
61 | 61 | function sections = help2struct(file,options)
|
62 | 62 | % struct('title','sectioname','content','descriptive text')
|
63 | 63 |
|
64 |
| - |
65 | 64 | helpStr = helpfunc(file.sourceFile);
|
| 65 | + |
| 66 | +if isempty(helpStr) |
| 67 | + process = helpUtils.helpProcess(0,1, {file.sourceFile}); |
| 68 | + |
| 69 | + process.getHelpText; |
| 70 | + |
| 71 | + helpStr = process.helpStr; |
| 72 | + |
| 73 | +end |
| 74 | + |
| 75 | + |
| 76 | + |
66 | 77 | docName = file.sourceInfo.docName;
|
67 | 78 | Title = regexprep(docName,'(\w*)\.(\w*)', ...
|
68 | 79 | ['$2' char(10) ' \(method of [[$1_index.html,$1]]\)' char(10) ' % ']);
|
69 | 80 |
|
70 | 81 | helpStr = [' % ' Title char(10) helpStr];
|
71 | 82 |
|
72 | 83 | helpStr = regexprep(helpStr,'(?<=^|\n) ','%');
|
| 84 | + |
| 85 | +keyWords = {'Input','Output','Syntax','Options','Flags','See also','Description'}; |
| 86 | +for i = 1:numel(keyWords) |
| 87 | + helpStr = regexprep(helpStr,['\n\%\s*' keyWords{i}],['\n\%\% ' keyWords{i}]); |
| 88 | +end |
| 89 | + |
73 | 90 | helpStr = globalReplacements(helpStr,options.outputDir);
|
74 | 91 | m = m2struct(helpStr);
|
75 | 92 |
|
|
0 commit comments