Link

class Link(val label: InlineContent, val url: String, val title: InlineContent?, val fileSystem: FileSystem? = null, val style: NodeStyle = NodeStyle.DEFAULT) : LinkNode, TextNode, StylableNode, PrimitiveFunctionBackedNode

A link.

Parameters

label

inline content of the displayed label

url

URL this link points to

title

optional inline title

fileSystem

optional file system where this link is defined, used for resolving relative paths

style

styling applied to the link

Constructors

Link copied to clipboard
constructor(label: InlineContent, url: String, title: InlineContent?, fileSystem: FileSystem? = null, style: NodeStyle = NodeStyle.DEFAULT)

Properties

Link copied to clipboard
open override val backingFunctionName: String

The name of the function that backs this node, from a loaded library.

Link copied to clipboard
open override val children: List<Node>
Link copied to clipboard

The error that occurred during processing, paired with the PipelineErrorHandler strategy to handle it. If null, no error occurred and the node is rendered normally via acceptOnSuccess.

Link copied to clipboard
open override val fileSystem: FileSystem?
Link copied to clipboard
open override val isBackingCallBlock: Boolean

Whether the synthesized backing call should be treated as a block call. Defaults to true; inline primitive nodes should override to false so the inline output mapper is used during expansion.

Link copied to clipboard
open override val label: InlineContent
Link copied to clipboard
open override val style: NodeStyle
Link copied to clipboard
open override val text: InlineContent

The text of the node as processed inline content.

Link copied to clipboard
open override val title: InlineContent?
Link copied to clipboard
open override val url: String

Functions

Link copied to clipboard
open override fun <T> accept(visitor: NodeVisitor<T>): T

Accepts the error as a node if an error is present, otherwise accepts this node normally via acceptOnSuccess.

Link copied to clipboard
open override fun <T> acceptOnSuccess(visitor: NodeVisitor<T>): T

Visits this node with the given visitor when no error is present.

Link copied to clipboard
open override fun copy(url: String): Link

Creates a copy of this link with the given url.

Link copied to clipboard

Returns a sequence of all nodes in the tree, where this is the root node. The sequence is generated by traversing the tree in depth-first order. The root node is excluded from the sequence.

Link copied to clipboard
Link copied to clipboard

Retrieves the stored media associated with this node, if any.

Link copied to clipboard
fun ErrorCapableNode.setError(throwable: Throwable, context: Context)

Sets the given throwable as the error of this node, paired with the error handler from context.

Link copied to clipboard
fun LinkNode.setResolvedUrl(context: MutableContext, resolvedUrl: String)

Registers the resolved path of this node within the document handled by context.

Link copied to clipboard

Strips the anchor (fragment) from the URL.

Link copied to clipboard

Materializes this node's properties into the arguments of the backing function call. Argument names must match the parameter names of the function identified by backingFunctionName.

Link copied to clipboard
fun Node.withChildren(newChildren: List<Node>): Node

Returns a copy of this node with its children replaced by newChildren.

Link copied to clipboard