mlreportgen.dom.ExternalLink class

Package: mlreportgen.dom
Superclasses:

Hyperlink to a location outside of document

Description

Defines a hyperlink to a location outside of the document.

Construction

externalLinkObj = ExternalLink(target,linkText) creates a hyperlink to the specified target and having the specified link text. This constructor creates a text object (mlreportgen.dom.Text) to hold the link text.

externalLinkObj = ExternalLink(target,linkText,linkTextStyleName) creates a hyperlink with the specified link text and style name.

externalLinkObj = ExternalLink(target,textObj) creates a hyperlink to the specified target using the specified Text object.

Input Arguments

expand all

The link target of the external link, specified as either a character vector (for a URL) or as an mlreportgen.dom.LinkTarget object.

The text to use for the link text.

Name of style to use for the link text.

Text object containing link text, specified by an mlreportgen.dom.Text object.

Output Arguments

expand all

External link, represented by an mlreportgen.dom.ExternalLink object.

Properties

expand all

Custom attributes of this document element, specified as an array of mlreportgen.dom.CustomAttribute objects. The custom attributes must be supported by the output format.

ID for this document element, specified as a character vector or string scalar. 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.

Name of link style defined in the template, specified as a character vector. The style specified by styleName must be defined in the template used to create the document to which the link is appended.

Tag for this document element, specified as a character vector or string scalar.

The DOM generates a session-unique tag as part of the creation of this object. The generated tag has the form CLASS:ID, where CLASS is the object class and ID is the value of the Id property of the object. Specifying your own tag value can help you to identify where an issue occurred during document generation.

This read-only property displays the URL of the link target of this hyperlink.

Methods

Method

Purpose

append

Append text or a Text, Image, or CustomElement object.

clone

Use ExternalLink.clone in a similar way to how you use Paragraph.clone.

Copy the external link

Examples

collapse all

import mlreportgen.dom.*
d = Document('mydoc');

append(d,ExternalLink('https://www.mathworks.com/','MathWorks'));

close(d);
rptview(d.OutputPath);