Image

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

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 var error: <Error class: unknown class>

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
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? = null
Link copied to clipboard
Link copied to clipboard
val width: Size?

Functions

Link copied to clipboard
abstract 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
fun copy(link: LinkNode): Image

Creates a copy of this image with the given link.

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