Skip to content

label-screenshot

Adds a caption band to an already-captured screenshot.

A store listing shows screenshots ONE AT A TIME, in a carousel, with no caption of its own — so an image has to say what it is showing. Without that, a shot of the state a plugin removes reads as a shot of the state the plugin causes, which is the opposite of the message.

The band is drawn over the BOTTOM of the frame, for two reasons: the top is where the content being demonstrated usually starts, and the bottom of an Obsidian frame is chrome — status bar, word count, sync indicator — which the band then covers rather than competing with.

This is post-processing, deliberately. The capture stays an untouched device frame, and rewording a label needs no re-shoot.

InterfaceDescription
ComputeLabelBandParamsParameters for computeLabelBand.
LabelBandGeometryThe geometry of the caption band.
LabelScreenshotOptionsOptions for labelScreenshot.
FunctionDescription
buildLabelSvgBuilds the SVG for the caption band.
computeLabelBandComputes the caption band’s size and position for a given image.
escapeSvgTextEscapes text for inclusion in SVG character data. A caption is authored per screenshot and can legitimately contain & or the angle brackets Obsidian uses in link syntax; unescaped, those make the SVG impossible to parse and sharp fails on a caption rather than on an image.
labelScreenshotDraws a caption band across the bottom of a screenshot. The image keeps its dimensions exactly: the band is composited OVER the frame, never appended to it, because the store expects a specific size.