Skip to content
Anjunar/ DOCS

Images

An image is an inline atom: its source is a validated media reference, its alternative text belongs to the document.

Concept

Media boundary

ImageExtension stores references to finished media. Uploads and pickers belong to the application; undo removes the image node, not the uploaded file.

Inspect an image

The Markdown image becomes one atom in the tree. Empty alt text explicitly marks decorative images.

A diagram: Architecture sketch beside text.

4 words · 5 nodes
ember.core.root/1 [document] ember.rich-text.paragraph/1 [images5] ember.core.text/1 [images1] "A diagram: " ember.image.image/1 [images3] ember.core.text/1 [images4] " beside text."
Source

Image commands

The application resolves a MediaReference through its media policy before dispatching InsertImage. UpdateImage keeps the node ID.

scala
val source = MediaUrlPolicy.default.unsafe("https://anjunar.com/diagram.png") val image = ImageNode( id = generator.nextFor(session.document), source = MediaReference(source), alt = "Architecture sketch" ) session.dispatch(ImageCommands.InsertImage, image) session.dispatch(ImageCommands.UpdateImage, _.copy(alt = "Updated diagram"))