Skip to content

Adding demos

In the getting started guide, you learned how to initialize the extension with a sample demo. In this guide, you will learn how to add your demos to the demo time configuration.

In version 1.9.0, Demo Time introduced a new Config Editor GUI that makes it easier to create and manage your demos and its related steps. That means that you now have the option to create your demos in a more visual way, without having to edit JSON or YAML files directly. You can still have the option to switch back to the code view if you prefer by setting the demoTime.openInConfigEditor setting to false.

Adding your first demo

Now that you have initialized the extension, you can start adding your first demo steps.

You can open the newly created demo.json file in the .demo folder manually, or you can click on the “eye” icon in the Demo Time view to open the demo steps editor.

Open the first demo file

Once the demo.json file is opened, you will see the visual editor to create new demos and steps.

Config Editor

Click on the Add Demo button to create your first demo.

Adding your first demo within the Config Editor

In the Demo Information section, you can define the settings for your demo like:

  • Title: The title of your demo.
  • Description: A brief description of what your demo does.
  • Demo ID: The unique identifier for your demo, which can be used to trigger the demo via the API, URI Handler, or runById action.
  • Icons: The icons that will be used in the tree view panel.
  • Notes: Any additional notes or information about your demo.

Adding steps

After the first demo is created, you can start adding steps. Each step that you add to a demo will be automatically ran in sequence when the demo is triggered.

Click on the Add Step button to create your first step.

Adding your first step within the Config Editor

In the Action dropdown, you can pick the action to perform for your step. The GUI will guide you through the available options per action.

Provided the step settings for the create action

Once a step is configured, you can add additional steps, or new demos. Here is an example to open the file after the create action:

Open the newly created file

In the header of the Config Editor, you can see the validation status. If you click on the message, you can see the detailed validation errors and warnings for your demo configuration.

Validation status in the Config Editor

Adding demo steps from a file

When you have a file open in the editor, you can add a demo step to your demo file by using the command Demo Time: Add demo step.

For example, if you want to highlight a piece of code, you can select the code and do the following:

  1. Open the command palette by pressing Ctrl+Shift+P or Cmd+Shift+P.
  2. Search for the Demo Time: Add demo step command.
  3. Click on the highlight action in the command palette.
Add a demo step from the "Demo Time: Add demo step" command
  1. Select the demo file in which you want to add the step (only if you have multiple demo files).
  2. Select if you want to add it to an existing demo or create a new one.

Executing the demo

Each demo you add will be available in the Demo Time view. You can execute each step by clicking on the demo title or starting the presentation mode.

First demo implementation

Adding notes to your demos

You are also able to add notes to your demos. These notes can be used to provide additional information for yourself or others who will be executing the demo.

The notes should be created as a markdown file.

When you open one of your demos in the Config Editor. Under the Demo Information section, you have the option to link a markdown file containing your notes or create a new one.

Configure notes in the Config Editor

By checking the Show notes file when demo is triggered option, the notes file will automatically open to the side of your editor when the demo is triggered.

Implementing other demos and steps

You can add more demos and steps to the demos array. In the actions section of the documenation, you can find all the available actions you can use to create your demos.