Test example for prettify_MATLAB_html
here is an example of prettify_MATLAB_html usage - process m-files with MATLAB publish command - process resulting html files with prettify_MATLAB_html
Contents
Key examples:
- Shift: ⇧ Shift / class="kbd"⇧ Shift</span>
- Button: Button / class="kbd">Button</span
- LMB (html only): class="kbd"<img style="height: 1em" src="images\LMB_click.svg"> left mouse click</span>
- RMB (html only): class="kbd"<img style="height: 1em" src="images\RMB_click.svg"> right mouse click</span>
- left arrow: ←
- right arrow: →
- Ctrl: ^ Ctrl
- Checkbox: [✓] Bio / class="kbd"[✓] b>Bio</b</span>
- Dropdown: Dropdown ▼ / class="dropdown">Dropdown ▼</span
- Editbox: editbox... / class="dropdown">editbox...</span
- Radio: ◉ Radio / class="kbd"◉ b>Radio</b</span>
Custom elements to use in the source .m file
Markup "tags"
Most prettify_MATLAB_html
features require the use of additional markup "tags" in the original source .m
file, for example to indicate where you want the disclosure boxes. You can click on the tag names in the table below to jump to examples of what these tags do and how to use them. If you add the helper buttons to the Toolbar, you can insert the [dtls], [smry], [targetn], [jumpton], [cssClasses], [class.class-name], [scalex], and [colour#] tags using those buttons.
Tag(s) | Purpose |
---|---|
[br] | Place anywhere to introduce an HTML line break. |
[brx] | Insert a line break with specified pixel height x; useful for creating spacing between lines where any empty line is too large a gap, or a large gap is required. |
[bottomMarginx] | Specify the size of the bottom margin of the current paragraph, in pixels x; useful for controlling spacing between text and inserted elements such as lists, images, embedded html, etc. |
[delsp] | Control spacing when using publish text markup
* ...* (bold), _..._ (italic), or
| ...| (monospaced ). In order to function
correctly, text that you markup with * , _, or | must often
be preceded by a space, but this can sometimes cause word-spacing issues. To solve this
problem, the [delsp] tag deletes a space character immediately following this
tag. |
[dtls] ... [/dtls] | Wrapped around a block of text will create a normally-open disclosure box around that text. These tags must be accompanied by a set of [smry] ... [/smry] tags (see below). |
[smry] ... [/smry] | These wrap around text inside a [dtls] ... [/dtls] block. The text wrapped in the [smry] ... [/smry] block is always displayed, regardless of the state of the disclosure arrow. The opening [smry] tag must immediately follow the opening [dtls] tag. |
[h2] ... [/h2]
[h2.CElink] ... [/h2] |
Used to create a second-level heading. This is the heading style used by publish for section headings, so these tags enable you to
insert headings without starting a new section. If the heading is inserted above [dtls] boxes, you can choose whether or not the heading
includes a collapse/expand link. The [h2] ... [/h2] tags create a heading with no link, whilst headings created with
[h2.CElink] ... [/h2] tags include a link. |
[targetn] | Where n is any integer, e.g. [target1], [target14]. Used to insert a link target for in-page linking. A link to the target is created using the [jumpton] ... [/jumpto] tags (see below). Note that no closing tag is required. |
[jumpton] ... [/jumpto] | These wrap around any text that you wish to serve as an in-page link to a target that you have specified with a [targetn] tag. |
[cssClasses] ... [/cssClasses] | These wrap around text where you define CSS classes that you wish to apply to other parts of the page using the [class.class-name] ... [/class] tags (see below). |
[class.class-name] ... [/class] | These wrap around text to which you wish to apply one of your CSS classes that are defined in the [cssClasses] ... [/cssClasses] block. |
[scalex] ... [/scale] | Where x is any positive number, e.g. [scale0.5], [scale1.2]. These wrap around text to which you would like to apply the specified scaling factor. |
[colour#] ... [/colour] | Where # is a six-digit hexadecimal number specifying the desired colour in RGB, e.g. [colourFF5614]. These wrap around text to which you would like to apply the specified colour. |
[themesEnabled] | Place this tag anywhere in your .m file to enable switching between light and dark themes. When enabled, a clickable
link is provided at the top-right of the page to allow the user to select a theme (see top of this page for example). |
[darkAlt] ... [/darkAlt] | Wrap these around any block that contains one or more images (including images that are auto-generated by code), where you wish to provide an alternative image in the case where the user selects the dark theme. |
Heading text
Disclosure box after heading
% Resize the training image and associated pixel label image.
function data = preprocessTrainingData(data, imageSize)
data{1} = imresize(data{1},imageSize);data{1} = repmat(data{1},1,1,3);
data{2} = imresize(data{2},imageSize);
end
List
test2
test3
test3
h3-tag Sub-header
Preprocessing of files