Main Content

formatAsHTML

Class: mlreportgen.dom.ProgressMessage
Namespace: mlreportgen.dom

Wrap message in HTML tags

Description

example

htmlMessageOut = formatAsHTML(message) returns the message text formatted with HTML tags.

Examples

expand all

This example uses formatAsHTML with the Web command to display the progress messages.

import mlreportgen.dom.*;
doctype = 'html';
d = Document('test',doctype);
d.Tag = 'My report';
     
dispatcher = MessageDispatcher.getTheDispatcher;
l = addlistener(dispatcher,'Message', ...
      @(src, evtdata) disp(evtdata.Message.formatAsHTML));
     
open(d);
dispatch(dispatcher, ProgressMessage('starting chapter',d));
p = Paragraph('Chapter ');
p.Tag = 'chapter title';
p.Style = { CounterInc('chapter'),...
   CounterReset('table'),WhiteSpace('pre') };
append(p,AutoNumber('chapter'));
append(d,p);

close(d);
rptview('test',doctype);
     
delete (l);

Input Arguments

expand all

Progress message, specified as an mlreportgen.dom.ProgressMessage object.

Output Arguments

expand all

Progress message with HTML tagging, specified as an mlreportgen.dom.ProgressMessage object.

Version History

Introduced in R2014b