1 function rpp_update_doc
2 % RPP_UPDATE_DOC Update built-in S-functions documentation.
3 % The documentation is updated based on the YAML comment in .c files.
4 set_param('rpp_lib', 'Lock', 'off');
5 blocks = find_system('rpp_lib', 'Type', 'block');
6 for i=1:length(blocks),
7 params = get_param(blocks{i}, 'ObjectParameters');
8 fields = fieldnames(params);
9 fn = get_param(blocks{i}, 'FunctionName');
10 % We have to unset Matlab's library path in order to run pandoc - it
11 % needs newer libc than the one shipped with Matlab
12 [rc, new_help] = system(['unset LD_LIBRARY_PATH; scripts/doc_parse.py --html ' fn '.c']);
15 throw(MException('rpp:pandoc_failure', ['Failed to extract doc from ' fn '.c']))
17 old_help = get_param(blocks{i}, 'MaskHelp');
18 if ~strcmp(old_help, new_help),
19 disp([blocks{i} ': Help not up-to-date - upating'])
20 set_param(blocks{i}, 'MaskHelp', new_help)
22 disp([blocks{i} ': Help up-to-date'])
25 set_param('rpp_lib', 'Lock', 'on');