-- Improved error handling, including display of name of file being processed, if warnings and/or errors occur
-- Saves help of built-in publish so it can be displayed on command line when user runs "help publish", when publish is overloaded
- Fixed html 5 compliance issues, some due to the built-in publish, and some due to prettify
- Added [h2] and [h2.CElink] tags
- Enhanced functionality of floating "return" link - arrow direction now updates as user scrolls or resizes window
Updated documentation to recommend that when creating in-page links to [dtls] boxes, the [targetn] tag should be placed immediately before the opening [dtls] tag.
- Adds a "return" floating button/link when user follows an in-page link (but not if page is viewed in MATLAB help browser)
- Other changes listed in .m file
If pages are viewed in the "Examples" tab on MATLAB Central:
- They have a scroll bar, so the [frameBufferx] tag is no longer required
- In-page links work in most browsers and jump to correct location (also applies to MATLAB help browser)
- Fixed issue with collapse-all/expand-all links in help browser of recent versions of MATLAB
- Improved spacing after generated code output and lists that appear at the end of [dtls] boxes
- Enables nesting of [dtls] boxes
- [dtls] boxes are now rounded on all four corners when closed
- Improved syntax checking for [/dtls] tags
- Other changes listed at end of .m file
- Added "built-in" publish CSS classes (see end of .m file for list) as valid when using the [class.class-name] tag (but these won't be in the pop-up list when the "class" Toolbar button is pressed.)
- Handles some incorrect syntax more gracefully
- Added support for nesting of css classes e.g. [class.a][class.b]this item will be formatted according to css classes a and b[/class][/class]
- Increased robustness of enclosing inline html in [dtls] sections
- Added support for new tags: [cssClasses], [class.class-name], [scalex], [colour#], [themesEnabled], and [darkAlt]
- Added dark theme
- Improved handling of Toolbar buttons
- Other minor changes; see end of .m file for more information
- Added method for adding shortcuts to Quick-Access Toolbar, that then allow easy adding of tags to source .m file
- Other minor tweaks and bug fixes (see end of .m file for more info)
Editor's Note: This file was selected as MATLAB Central Pick of the Week
prettify_MATLAB_html gives you additional features when publishing an .m file to html using MATLAB's publish function:
1. With a few easy-to-use "tags" in your source .m file, you can:
— Create collapsible sections, similar to those seen in "official" MATLAB help pages.
— Create internal page links to jump to other parts of the page.
— Insert line breaks.
— Insert spacing of specified pixel height.
— Specify size for any text.
— Specify colour for any text.
— Insert your own CSS classes to style text however you wish.
— Optionally, give the user a choice to display the page with a “dark” theme.
— Easily switch between elements in the page according to which theme (“light” or “dark”) is selected by the user.
2. Provides Quick-Access Toolbar buttons to insert the prettify_MATLAB_html tags when editing your .m file.
3. Provides a built-in table style to use when embedding an html table.
4. Automatically ensures that images do not exceed page width (images that would be wider than the page at their full size, scale with the width of the page).
5. Gives inline code and execution results a horizontal scroll bar if they do not fit in the width of the page.
Please click here for a full description of prettify_MATLAB_html's usage and features.
Cite As
Harry Dymond (2022). Prettify MATLAB html (https://www.mathworks.com/matlabcentral/fileexchange/78059-prettify-matlab-html), MATLAB Central File Exchange.
Retrieved .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country
sites are not optimized for visits from your location.