View source: R/template-variables.R
| generate_template_variables | R Documentation |
Constructs the named list passed to whisker::whisker.render() when
assembling the Electron app. Kept separate from process_templates()
so the variable construction is testable independently.
generate_template_variables(
app_name,
app_slug,
app_type,
runtime_strategy,
icon,
backend_module,
brand,
config,
is_multi_app = FALSE,
apps_manifest = NULL
)
app_name |
Character. Display name of the app. |
app_slug |
Character. Path-safe slug derived from app_name. |
app_type |
Character. |
runtime_strategy |
Character. Resolved runtime strategy. |
icon |
Character path to icon file, or NULL. |
backend_module |
Character. Resolved backend filename (e.g., "native-r.js"). |
brand |
List or NULL. Parsed |
config |
List. Effective merged configuration. |
is_multi_app |
Logical. |
apps_manifest |
List or NULL. Multi-app manifest entries. |
Most variables here correspond to a {{...}} placeholder in
inst/electron/shared/main.js, lifecycle.html, or launcher.html.
The list is a superset: some entries are serialized into
backend_config_json (and consumed by the backend modules rather than a
template) or are reserved for future placeholders. Adding a new
placeholder requires adding it here.
A configuration string that a template's JavaScript (main.js or an
inline <script> in an HTML template) places inside a single-quoted
literal also has an escaped *_js entry (see js_str()), which the
template renders with a triple mustache, as in '{{{app_name_js}}}'.
JSON inlined into a script is built with json_for_script(). The plain
entries are HTML-escaped by a double mustache and belong in HTML markup.
Named list suitable for Whisker rendering.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.