Expand description
Lower #image and #figure parser directives into semantic nodes.
Functions§
- build_
image_ 🔒attributes - Walk a directive’s argument list and produce the attribute map for
an [
NodeKind::Image] node, including the decoded pixel buffer. ReturnsNone(and emits diagnostics) if the path argument is missing or the bytes can’t be decoded – the caller drops the node in that case rather than emitting a half-built image. - lower_
figure_ 🔒directive - Lower a
#figure(image: ..., caption: ...)directive into a [NodeKind::Figure] node with two children: an Image node (built the same way#image(...)would build it) and a caption paragraph. The caption is rendered beneath the image by the layout engine. - lower_
image_ 🔒directive - Lower a top-level
#image(...)directive into a single [NodeKind::Image] node hanging off the document root. The decoded pixel buffer and pixel dimensions are stashed in attributes so the layout engine and PDF backend don’t have to re-open the source file. - string_
content_ 🔒span