mlreportgen.dom.OrderedList class

Package: mlreportgen.dom
Superclasses:

Create ordered list

Description

Create an ordered (numbered) list.

Construction

orderedListObj = OrderedList() creates an empty ordered list.

orderedListObj = OrderedList(items) creates an ordered list of the specified items.

Input Arguments

expand all

Content to include in an ordered list, specified as a:

  • One-dimensional array of doubles

  • One-dimensional array of character vectors

  • One-dimensional categorical array

  • One-dimensional cell array

The cell array can contain a combination of the following:

  • A character vector

  • A number

  • A Boolean value

  • One of the following DOM objects:

    • mlreportgen.dom.Text

    • mlreportgen.dom.Paragraph

    • mlreportgen.dom.ExternalLink

    • mlreportgen.dom.InternalLink

    • mlreportgen.dom.Table

    • mlreportgen.dom.Image

    • mlreportgen.dom.CustomElement

  • Horizontal one-dimensional array (for a sublist)

Output Arguments

expand all

An ordered list containing the specified list items.

Properties

expand all

The output format must support the custom attributes of this document element.

ID for this document element, specified as a character vector. The DOM generates a session-unique ID when it creates the document element. You can specify your own ID.

Format objects that specify the format of a document element.

The style specified by Stylename must be defined in the template used to create the document element to which you append this list.

Tag for the document element, specified as a character vector.

The DOM generates a session-unique tag when it creates the document element. Structure the tag as class:id, where class is the class of the element and id is the value of the Id property. You can specify a tag to replace the generated tag. Specifying your own tag can make it easier to identify where an issue occurred during document generation.

Methods

Method

Purpose

append

Append items to this list.

clone

Use the OrderedList.clone method similar to how you use Paragraph.clone.

Copy the list.

Examples

collapse all

import mlreportgen.dom.*;
d = Document('test','html');

ol = OrderedList({Text('a'), 'b', 1,...
    {'c', Paragraph('d')}});
append(d,ol);

close(d);
rptview('test','html');

Compatibility Considerations

expand all

Behavior changed in R2019b