Aa 0.14.1

Pictures and media

A picture is written as a Markdown image, ![caption](address), and drawn in place as one piece of the text.

A picture and its caption

Write under a picture to change its caption. The second has none yet.

What it stores

A picture’s caption is its alt text. Write under the picture to change it; the Markdown follows. Right-click a picture and choose Add a caption to write one.

A picture is its own size, up to sixteen squares wide, until it is given a width of its own. Rest the pointer on it and a grip shows on its end edge: pull it, and the picture is a whole number of squares wide, from four to as many as its line holds. Let go, and the width is written into the Markdown as the picture’s title, one step to undo:

![A mountain reflected in a still lake](lake.jpg "w24")

A double press on the grip gives the picture back its own size. In columns a picture without a width fills its column.

An image whose address ends in mp4, webm or mov is drawn as a film, and one ending in mp3, wav, ogg or m4a as sound, each with the browser’s controls. A data address of an audio or video type is drawn the same way.

![The interview](https://example.com/interview.mp3)![A walk through the studio](https://example.com/studio.mp4)

Aa never keeps or uploads a file itself. A picture or file pasted or dropped into the editor is handed to onFiles, and your app uploads it and writes its address back:

const editor = createEditor(host, {  onFiles: async files => {    for (const file of files) {      const url = await upload(file)      const at = editor.selection()      if (at) editor.replace(at.start, at.end, `![${file.name}](${url})`)    }  },})

Files dropped or pasted

Drop a picture here, paste one, or type /image. This page keeps it in the Markdown as a data address; an app uploads it.

What it stores

editor.insertFile(file) hands a file to onFiles the same way, for a picker of your own.

Carry one picture to another’s side to stand them in columns.

Pictures are Aa’s first atom, imageAtom, on by default. An app that gives its own atoms includes imageAtom among them to keep pictures.