MATLAB Answers

Why does web('name.html','-new') open the html-file in the Help browser?

6 views (last 30 days)
per isakson
per isakson on 18 Sep 2020
Commented: per isakson on 19 Sep 2020
Experiments with R2018b show that
  • web('name.html','-new') honors the Matlab documentation and displays 'name.html' in the Matlab Web Browser only when there doesn't exist an info.xml that points to the folder of 'name.html'.
  • when there exists an info.xml that points to the folder of 'name.html', web('name.html','-new') displays 'name.html' in the Matlab Help Browser
Questions:
  • The behavior that web() dispays in the Help browser is that a bug or a poorly documented feature?
  • Is there a way to force web() to always display in the Matlab Web Browser?

  4 Comments

Show 1 older comment
Harry Dymond
Harry Dymond on 18 Sep 2020
Hi there,
Thanks for highlighting this issue. Please could you provide more details on what exactly is the content of the "info.xml" file, and where it is located, relative to the .html file?
Edit - sorry, I didn't see that your first mention of info.xml is actually a link that explains more.
Perhaps I'm missing something, but isn't the whole point of info.xml to make .html pages open in the help browser? Or are you saying that you feel that the web() function should override what the .xml is instructing MATLAB to do?
per isakson
per isakson on 18 Sep 2020
My mistake, I was too biased to take in the paragraph on the Help browser in the documentation of web(). Thus, the behavior I describe in my question is a documented feature. Period.
@Mohammad Sami, thank you for the suggestion. Following it, I found that with R2018b it's possible to force the use of the Web Browser by overloading helpUtils.isUnderDocroot with a simple function that always returns false. However, messing with the Matlab code is a no-no.
@Harry Dymond, I've documented a toolbox using Display Custom Documentation and publish(). My toolbox appears in the Supplementary Software section in the Matlab documentation and to the user it's part of the "Matlab Help". It never occured to me that web() should have anything to do with that. Obviously, the designers at The MathWorks see it differently.
publish() is a bit limited and I found your FEX-submission promising.
To me the Help Browser appears to be based on the Web Browser and I was surprised to learn that the Help browser responds neither to "expand/collapse all on page" nor to "expand/collapse all". My objective is to use the html-files with the Matlab Help Browser and I was a bit upset. However, the triangle-icons works.
The behavior of web() affects me when I write the files, but that's not a big problem.
I'll make a small example to illustrate the problem and return here tomorrow.
per isakson
per isakson on 19 Sep 2020
There was a bug in Prettify MATLAB html. It is fixed in version 4.2. Now expand and collapse works as advertised.

Sign in to comment.

Answers (0)

Categories

Products


Release

R2018b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by