IRootLab
An Open-Source MATLAB toolbox for vibrational biospectroscopy
help2.m
Go to the documentation of this file.
1 %> @file
2 %>@ingroup usercomm
3 %> @brief Calls browser with Doxygen help for prefix
4 %>
5 %> MATLAB web browser is absolutely crap! Doxygen 1.7.4 does not use frames anymore and has lots of JavaScript when its advanced options are set.
6 %> However, even turning all JavaScript off, MATLAB web browser still fails to produce a decent rendering of Doxygen help.
7 %>
8 %> Therefore, will open help in external browser! Windows users shouldn't have any problem. I had a problem in
9 %> Linux with starting Firefox, but using NetSurf it worked fine (although NetSurf does not support JavaScript).
10 %>
11 %> MATLAB external browser is configurable at File->Preferences...->Web
12 function help2(prefix)
13 
14 path_assert();
15 global PATH;
16 
17 flag_default = 0;
18 url = [];
19 
20 if nargin < 1 || isempty(prefix)
21  flag_default = 1;
22 else
23  [~, prefix] = fileparts(prefix);
24  prefix = strrep(prefix, '_', '__'); % Doxygen replaces all underscores with double underscores
25 
26  url = [PATH.doc, '/html/', prefix, '_8m.html'];
27 
28 % % dd = dir(fullfile(PATH.doc, 'html', [prefix '*.html']));
29 % % if ~isempty(dd)
30 % % url = fullfile(PATH.doc, 'html', dd(1).name);
31 % % % try
32 % % % web(url, '-browser');
33 % %
34 % % % irverbose('Opened help page in system web browser', 3);
35 % % % catch ME
36 % % % irverbose('Could not launch system web browser, using MATLAB browser', 3);
37 % % % irverbose('Could not launch system web browser, using MATLAB browser', 3);
38 % % % web(url);
39 % % % end;
40 % % else
41 % % answer = questdlg(sprintf('No help found for ''%s''. Would you like to open IRoot main help page?', prefix), 'Help', 'Yes', 'No', 'Yes');
42 % % switch (answer)
43 % % case 'Yes'
44 % % flag_default = 1;
45 % % end;
46 % % end;
47 end;
48 
49 if flag_default
50  url = [PATH.doc, '/html/index.html'];
51 end;
52 
53 if ~isempty(url)
54  stat = web(url, '-browser', '-new');
55  if stat == 0
56  irverbose(['Launched URL "', url, '" in external browser', 0]);
57  else
58  inputdlg('Couldn''t start web browser. Please manually paste the following URL into your web browser:', 'Error', 1, {url});
59  end;
60 
61 % web(url, '-new');
62 end;