Inputs
Oicana supports two types of inputs. A json input takes structured data while binary data can be passed into templates through a blob input.
Inputs are defined in the template manifest. Integrations can list all inputs of a template to, for example, validate input values or offer an editor.
The type
type
property of the input definition must be json
json
. The only other required property is key
key
.
A json schema file can be used for input validation.
Early Alpha
The json schema validation is not complete yet. You can set the property and maintain the schema, but at the moment it is ignored by Oicana.
Blob inputs can be used for binary data like images. Additional metadata can be used to further specify the type of binary data in the input.
As a common use case for blob inputs, images have special support in the oicana
oicana
Typst package.
Inputs can define two different fallback values, default
default
and development
development
. These fallback values differ in priority based on which mode the template is compiled in.
When compiling a template in development mode, input values have the priority
- Explicit input value (for example through an integration)
development
development
valuedefault
default
value
If you compile in production mode, the development
development
value is ignored:
- Explicit input value (for example through an integration)
default
default
value
While developing an Oicana template in a Typst editor, it will be compiled in development mode. It makes sense to define development
development
values for all required inputs of you template to have a functioning preview.
Considering a template with the files development-data.json
development-data.json
, default-data.json
default-data.json
, development-logo.png
development-logo.png
, and default-logo.png
default-logo.png
. It could define the following inputs:
The default.meta
default.meta
objects for blob fallback values are optional.
In the preview of an editor, the content of development-data.json
development-data.json
and development-logo.png
development-logo.png
would be used. If compiled in production mode through an Oicana integration, the default fallbacks would be used if the input values are not set programmatically.