-
-
Notifications
You must be signed in to change notification settings - Fork 5
Conversation
Working prototype on b6f246a To build Matlab doc: FileList = genToolboxHelp('/Users/julien/code/shimming-toolbox', 'shimming-toolbox', {'Ui', 'tests', 'misc', 'Img', 'external', 'example', 'docs', 'doc', 'Coils', 'aux_hardware'}, true, false) |
Adding a Contents.m file within each folder enables to do this:
On the other hand, if the Contents.m file is not present in the folder, then it recognizes it as a package, and the help is much nicer:
so, we should not have Contents.m files for packages. EDIT: this mush be a new Matlab feature, but even without Contents.m file for non-packages, it does list all the files. So let's get rid of this Contents.m file. |
because it has personalized install info
Was hard-coded line. now replaced with global FOLDERHTML
Ready to be tested:
startup
FileList = genToolboxHelp('/Users/julien/code/shimming-toolbox', 'shimming-toolbox', {'doc', 'docs'}, false, true)
doc The Documentation windows pops-up, go at the bottom and click on "shimming-toolbox Toolbox". You should see this: |
I followed the procedure and had the problem with We probably want to create a template on how to create new functions so that both the website and the matlab documentation look good. |
yup! this is the purpose of shimming-toolbox/shimming-toolbox#133. Out of the scope of this PR. Once merged, we can work on this issue.
yup! i'll find a fix to it before merging. |
🤔 mmh that's annoying. if you could find a better fix to it that would be awesome |
Actually it's an old feature that, indeed, doesn't seem completely worked out: It's nice that it prints the contents automatically without the Contents.m file, but it seems to me having a package overview is sensible, and since |
funny you are writing this now, as I am just realizing that the issue described here is caused by a missing Contents.m file 😬. So I am currently creating one per folder, with brief description about the purpose of each folder/package.
Awesome! |
Missing page issue fixed in c240021. Output looks like this: I suggest to indicate with (package) when a folder is a package. |
The missing page issue is also for all the other headers, not only +imutils as shown for the "coils" section here : |
yes, i was just looking for a proper solution for imutils, which can then be applied to the other folders. At this point, given the large refactoring ahead, i suggest we don't spend time populating entries that will disappear in the short term (e.g. Coil will be replaced by +coil, etc.). The purpose here is to settle on a set of conventions, that will then be applied to the code at large (in subsequent PRs). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Current problem is building the doc the first time throws an error with builddocsearchdb
will open an issue for it.
|
Context
This PR adds the necessary files to generate a Matlab documentation, within Matlab's browser. The various pros are:
This PR will be the foundation for establishing docstrings conventions: shimming-toolbox/shimming-toolbox#133
Things to figure out
helpdoc.xml
file (which includes all entries of the doc). Possibly helpful:Contents.m
: not needed (see discussion below).Tips & tricks
Formatting Matlabs's markup
https://www.mathworks.com/help/matlab/matlab_prog/marking-up-matlab-comments-for-publishing.html
Publish Live scripts as html
The function
publish
converts .m files to html. However, this does not work for Live script .mlx files. The solution is to use:builddocsearchdb: Could not write search database
if running into the following error:
The solution is to remove the path to the
info.xml
file and add it again. Matlab will then parse it.builddocsearchdb: There is no installed product with this help location
Solution: the path to the output doc/, included in the info.xml file, should be relative. Any change to the info.xml file should be followed by an rmpath/addpath to refresh the parsing of the info.xml file (or , restart Matlab).
Publish for package files
Example for
+imutils/
package, command is: