rmkit

a site about remarkable app dev

SAS spec

NOTE: an overview of SAS is available here. this page details the spec itself.

@justify left
button 50 50 400 50 I'm a button
label 50 150 400 50 I'm a label
textinput 50 100 400 50 I'm a textinput
[paragraph 80 450 800 200 I'm multi-line text, I'm multi-line text, I'm
multi-line text, I'm multi-line text, I'm multi-line text, I'm multi-line text,
I'm multi-line text, I'm multi-line text, I'm multi-line text, I'm multi-line
text, I'm multi-line text, I'm multi-line text, I'm multi-line text, I'm
multi-line text, I'm multi-line text, I'm multi-line text,]

simple app script is read line by line and parsed. it’s expected that each line contains either a directive or a widget. a widget may span multiple lines if it uses square brackets to enclose itself.

widgets

all widgets are placed using absolute positioning and require their upper left corner and width and height to be passed when creating the widget.

there are several core widgets: label, paragraph, button, textinput, textarea, image, range.

a widget can be given an ID by supplying it after the widget type, like widget:ID, for example: button:r2 is a button called r2. the labels are useful for figuring out what buttons or widgets were interacted with.

widgets are specified as their x, y, width and height parameters, followed by zero or more values.

x and y must be an integer or a percentage value or a keyword

w and h must be an integer or a percentage value or a keyword

supported keywords for x and y are:

supported keywords for width and height are:

directives

directives are a way of giving meta-instructions to the simple interpreter, controlling things like the font size, padding and other attributes.

output

simple will run until a button is clicked or an input’s value is changed, at which points it prints out the the components’s id and updated value. if a timeout is supplied, simple will exit if there is no input within K seconds

if there are no components that accept input and no timeout is supplied, then simple will exit after drawing to screen.

when a textinput is edited:

when a button is clicked:

contact

want to discuss the spec or implement a backend? see some bugs? get in touch on github! or reach out on discord / reddit