Advanced: Workshop
Last updated
Last updated
In some cases, you'll need to build or change mods in the Workshop, which can be found in the . This section shows you how to configure basic YAML files in the Workshop.
PixieBrix uses YAML, a human-friendly markup language, for defining bricks. To learn the basics of using YAML, view one of the following tutorials:
To create a list, use -
below the parent entry:
You can also create a list of dictionaries. Note the indentation!
There are several situations where you must surround a value with double quotes ("
) to ensure it’s interpreted as a string.
PixieBrix supports @user
and @organization
to namespace bricks. When using a namespaced brick id, you must surround the id in double quotes because @
is a reserved character in YAML
Certain JQuery selectors must be enclosed in quotes so that they’re interpreted as strings:
"#id-selector"
: the id selector #
is interpreted as starting a comment if not surrounded by quotes
"[name='submit']"
: the attribute selector [
is interpreted as a list if not surrounded by quotes
Templates are described in more detail below. Because they begin with a {
if you don’t surround them in quotes they’re interpreted as a mapping
"{{ myVariable }}"
The exception is when writing multi-line strings using |
you do not have to enclose them in quotes:
In PixieBrix, service configurations and output keys are referred to using a @
before their name. Because they start with a “@” you must enclose them in double-quotes.
The apiVersion
directive controls how PixieBrix's runtime interprets the brick.
Whenever backward incompatible changes are introduced, we increment the apiVersion. If you do not specify the apiVersion, it defaults to v1
v1
: our initial release
v2
: made data flow between bricks explicit. Bricks had to reference data from previous bricks using the @outputKey
for that brick
v3
(supported in the runtime, but not yet supported in the Page Editor). Uses explicit tags for !var
, !mustache
, and !nunjucks
Arrays are indexed using a numeric property:
PixieBrix supports a number of templating engines for wiring together bricks. To specify the template engine, include a templateEngine
key when configuring a brick in a mod (kind: extensionPoint
) or composite brick (kind: component
) definition
When a value starts with a mustache template, you must you must surround the value in double-quotes ("
).
Mustache will insert the variable’s value if it exists, or otherwise insert a blank
The Mustache template engine automatically HTML-escapes the value, to make them safe for displaying on a webpage. When calling APIs you’ll want to use the value directly by using a triple mustache or the &
syntax:
</aside>
Use the following brick directive when creating components and mods
You can provide a path, which also supports :
By default, PixieBrix uses the popular template engine.
is a Javascript port of supports logic including conditionals and mathematical expressions.
<aside> ⚠️ Warning: Always review bricks using Nunjucks templates before activating them. Nunjucks templates can . This issue will be mitigated by