shimming-toolbox / shimming-toolbox-matlab

Code for performing real-time shimming using external MRI shim coils
GNU General Public License v3.0
16 stars 5 forks source link

builddocsearchdb throws an error when building custom toolbox documentation #144

Open po09i opened 4 years ago

po09i commented 4 years ago

builddocsearchdb throws an error the first time the custom toolbox documentation is built if you are on the same folder as info.xml. Current way to fix it is restarting matlab and launching the doc again or rmPath/addPath by going to another folder first.

To reproduce : open Matlab

startup
FileList = genToolboxHelp('PATH_TO_SHIMMING_TOOLBOX', 'shimming-toolbox', {'doc', 'docs'}, false, true)

Quitting matlab and rerunning the commands above fixes the issue.

Then to reproduce, delete these files

doc/helptoc.xml

and run the commands again.

po09i commented 4 years ago

More investigation concluded that the paths need to be updated in a specific way : The following code does not work when ran the normal way using the above procedure however, it does work if adding a breakpoint on the addpath line and continuing the execution. (This also means that doing the each lines manually works)

%% 6) Create a searchable toolbox help database
% Can be used to search for keywords in your published .m-files
fprintf('**********Searchable database generation: **********\n')
if createDB
    cd ..
    rmpath(genpath('shimming-toolbox'))
    addpath(genpath('shimming-toolbox'))
    cd shimming-toolbox
    builddocsearchdb(pathHelpTOC);
end

It seems like Matlab needs to stop running so that it can register that the paths have updated. Using rehash does not work. Any Ideas?

jcohenadad commented 4 years ago

hum, that's annoying. However, following on a previous discussion (https://github.com/shimming-toolbox/shimming-toolbox/issues/133#issuecomment-647679436), maybe we can put this issue on hold for now?