Content

interface Content

Provides an iterable list of content Elements.

Types

Link copied to clipboard
data class Attribute<V>(val key: Content.AttributeKey<V>, val value: V)

An attribute is an arbitrary key-value metadata pair.

Link copied to clipboard
data class AttributeKey<V>(val id: String)

An attribute key uniquely an attribute.

Link copied to clipboard

An object associated with a list of attributes.

Link copied to clipboard
data class AudioElement(val locator: Locator, val embeddedLink: Link, val attributes: List<Content.Attribute<*>> = emptyList()) : Content.EmbeddedElement, Content.TextualElement

An audio clip.

Link copied to clipboard

Represents a single semantic content element part of a publication.

Link copied to clipboard

An element referencing an embedded external resource.

Link copied to clipboard
data class ImageElement(val locator: Locator, val embeddedLink: Link, val caption: String?, val attributes: List<Content.Attribute<*>> = emptyList()) : Content.EmbeddedElement, Content.TextualElement

A bitmap image.

Link copied to clipboard
interface Iterator

Iterates through a list of Element items asynchronously.

Link copied to clipboard
data class TextElement(val locator: Locator, val role: Content.TextElement.Role, val segments: List<Content.TextElement.Segment>, val attributes: List<Content.Attribute<*>> = emptyList()) : Content.TextualElement

A text element.

Link copied to clipboard

An element which can be represented as human-readable text.

Link copied to clipboard
data class VideoElement(val locator: Locator, val embeddedLink: Link, val attributes: List<Content.Attribute<*>> = emptyList()) : Content.EmbeddedElement, Content.TextualElement

A video clip.

Functions

Link copied to clipboard
open suspend fun elements(): List<Content.Element>

Returns all the elements as a list.

Link copied to clipboard
abstract operator fun iterator(): Content.Iterator

Creates a new iterator for this content.

Link copied to clipboard
open suspend fun text(separator: String = ""): String?

Extracts the full raw text, or returns null if no text content can be found.