Image

class Image(val link: LinkNode, val width: Size?, val height: Size?, val referenceId: String? = null, val usesMediaStorage: Boolean = true) : CrossReferenceableNode, ErrorCapableNode, PrimitiveFunctionBackedNode

An image.

Parameters

link

the link the image points to

width

optional width constraint

height

optional height constraint

referenceId

optional ID that can be cross-referenced via a com.quarkdown.core.ast.quarkdown.reference.CrossReference

usesMediaStorage

whether this image should be registered in the media storage by com.quarkdown.core.context.hooks.MediaStorerHook, if the media storage is enabled in the context

Constructors

Link copied to clipboard
constructor(link: LinkNode, width: Size?, height: Size?, referenceId: String? = null, usesMediaStorage: Boolean = true)

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

Any error associated with the link will be surfaced as an error on the image itself.

Link copied to clipboard
val height: Size?
Link copied to clipboard

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
Link copied to clipboard

The CrossReferenceableNode.referenceId of this node, if it is a real linkable ID (i.e. not the placeholder).

Link copied to clipboard
open override val referenceId: String?
Link copied to clipboard
Link copied to clipboard
val width: Size?

Functions

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

Accepts a visitor.

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

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

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