Skip to main content

Module image_lower

Module image_lower 

Source
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. Returns None (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 🔒