Clickable actionsAuthoring

Steps that run when you click them

A clickable action is a block in the workshop instructions that does the step when clicked. It runs a command in the right terminal, opens or changes a file in the editor, switches a dashboard tab, downloads a file or runs a check. Nobody mistypes a command or edits the wrong line, so the people taking the workshop spend their time on what it teaches, not on typing.

What you can do with it

  • Two commands from the instructions, one in each terminal: the application applied in the first, and its pods watched as they start in the second.

    Run commands in the right terminal

    Run a command in the first terminal, another one, or all of them, clearing the terminal first if you like. Interrupt a command that never returns, or send input, such as a password, to one that is waiting for it.

  • The editor, opened at the deployment by one action, with the image tag a second action selected by a regular expression, and actions below to replace it, set a YAML value and create a file.

    Open and change files in the editor

    Open a file at a line, select text by an exact match or a regular expression and replace it, insert lines, or create a file. YAML files change by path, such as spec.replicas, and a click can run a VS Code command.

  • A dashboard tab that an action in the instructions created, showing the application the step deployed.

    Drive the dashboard

    Open a URL in a new browser tab, bring a dashboard tab to the front, or create, reload and delete tabs, for example one showing the application the step just deployed.

  • Actions that copied the application's address, downloaded the Session's kubeconfig and uploaded a reading list, which the terminal lists in the uploads directory.

    Copy, download and upload files

    Copy text to the clipboard, download a file from the Session, such as its kubeconfig, or upload a file into it.

  • An action that ran as the page opened, a section that ran its two commands one after the other when it was opened, and a question and an optional step still folded away.

    Pace the page

    Hide optional steps or questions in sections that open with a click, start an action as soon as the page loads, and have each action trigger the next one when it succeeds.

How you use it

A clickable action is a fenced code block in a page of the workshop instructions. The fence names the action, and the block's body is YAML. This one clears the first terminal and runs a command in it:

```terminal:execute
command: echo "Execute command."
clear: true
```

Actions for the editor need the editor, which is off until the workshop definition turns it on:

resources/workshop.yaml
spec:
session:
applications:
editor:
enabled: true

Then one block finds text in a file and replaces it, with nothing for anyone to select and paste wrong:

```editor:replace-matching-text
file: ~/exercises/sample.txt
match: "nginx:1.19"
replacement: "nginx:1.21"
```

Any action written in YAML can also start on its own when the page loads (autostart), trigger the next action when it succeeds (cascade), stay out of sight (hidden) and send an analytics event when clicked (event). The workshop instructions docs list every action and its fields.

Limits

What it does not do, and what it needs from you, so you can judge it before you build on it.

Where it is used

Use cases that rely on it

Deploy it from the Hub

The Hub is a catalog of workshops you deploy on your own Educates, each with one command. These ones show this Feature at work.

Explore the Hub

Try it yourself, or talk to us

Get started runs Educates on your laptop with a first workshop in a few commands. Get help is where you ask the community, and where you can hire the people who build Educates.