Crate ifengine_macros

Crate ifengine_macros 

Source
Expand description

See [ifengine::elements]

Macros§

YIELD
Immediately yield a [Response::View] with the current [View].
alts
Cycle between multiple alternative spans on click.
back
Create a link [Span] that navigates backward.
choice
Conditionally display one of several choices based on user selection.
click
Run code on click.
count
Use a closure to compute a span based on how many times the span has been clicked.
dchoice
A version of dynamic_choice with slightly abbreviated syntax.
dparagraph
Create a paragraph with interactive elements from a string.
dynamic_choice
Executes code for a set of selectable choices. Prefer to use dchoice for brevity.
fresh
Run a function only once when the page is first loaded.
h
Markdown heading.
hr
Horizontal rule (<hr/>).
img
Push an image from a string literal.
in_sim
Returns whether the current function is running in a [crate::run::Simulation].
inc_key
Increment the value of a key. See read_key.
mchoice
Execute a set of conditional expressions based on user-selected choices.
mparagraph
Create a paragraph with interactive elements from a string.
page_dbg
Debug display the current [PageState]
paragraph
Create a paragraph from a sequence of spans.
paragraphs
Shorthand for creating multiple paragraphs from a sequence of [crate::view::Line]’s.
push
Push a (Object)[ifengine::view::Object] to the current (View)[ifengine::View]
read_key
Read the value of a key of the internal [PageState]
read_key_mask
Read a key as a bitmask. See read_key.
reset_key
Reset (remove) a key from state. See read_key.
set_key
Set a key to a value. See read_key.
set_key_mask
Set individual bits of a key to true. See read_key_mask.
tag
Tags the current page.
text
Pure text element, constructed from a sequence of spans.
texts
A sequence of text elements. See text.
unset_key_mask
Clear individual bits of a key. See read_key_mask.
untag
Removes a tag
view_dbg
Debug display the current view

Attribute Macros§

ifview
Decorate your function with this.