Compositors
Term.Compositors.Compositor
Term.Compositors.Compositor
Base.show
Term.Compositors.collect_elements
Term.Compositors.extract_renderable_from_kwargs
Term.Compositors.get_elements_and_sizes
Term.Compositors.parse_single_element_layout
Term.Compositors.render
Term.update!
Term.Compositors.Compositor
— Typemutable struct Compositor
layout::Expr
elements::Dict{Symbol,LayoutElement}
end
A layout compositor, creates an updatable layout from an expression.
Term.Compositors.Compositor
— MethodCompositor(layout::Expr; hpad::Int = 0, vpad::Int = 0, check::Bool = true, kwargs...)
Constructor. Parses a layout expression and creates LayoutElements for each element in the expression.
Base.show
— MethodBase.show(io::IO, ::MIME"text/plain", compositor::Compositor)
Show a compositor.
Term.Compositors.collect_elements
— Methodcollect_elements(ex::Expr)
Collects elements (individual LayoutElements) that are in a layout expresssion.
Term.Compositors.extract_renderable_from_kwargs
— Methodextract_renderable_from_kwargs(s, h, w; kwargs...)
When passing kwargs to a Compositor
, check for renderables that are to be assigned to its content.
Term.Compositors.get_elements_and_sizes
— Methodget_elements_and_sizes(ex::Expr)
Get elements names and sizes.
Term.Compositors.parse_single_element_layout
— Methodparse_single_element_layout(ex::Expr)
Parse an expression with a single layout element, like :(A(5, 25)) or :(A)
Term.Compositors.render
— Methodrender(compositor::Compositor; show_placeholders = false)
Render a compositor's current layout.
Get a renderable from each LayoutElement
in the compositor and evaluate the layout expression interpolating the renderables.
Term.update!
— Methodfunction update!(
compositor::Compositor,
id::Symbol,
content::Union{String,AbstractRenderable},
)
Update a LayoutElement
in a Compositor
with new content. If the content's measure doesn't match the pre-defined size of the LayoutElement
, it prints a warning message.