A Ballerina notebook is a canvas, which combines Markdown text and executable Ballerina source code. Markdown and Ballerina code snippets are supported by Ballerina notebook cells.

Info: Make sure your VS Code version is 1.67.0 or higher when using Ballerina notebooks.

Create a notebook

You can create Ballerina notebooks in the VS Code editor (by adding the .balnotebook extension for file names) via the Command Palette of the VS Code editor as shown below.

Execute the code

Click the Run button available at the left-hand side of the cell or press the shift + enter keys to execute the Notebook cells.

Tip: Additionally, the Run All, Execute Above Cells, Execute Cell and Below, Clear outputs of All Cells, and Restart Notebook actions are available in the user interface.

Edit the code

You can use the IntelliSense features to edit the code on notebooks as shown below.

View variables

You can view variables in notebooks as shown below.

Debug notebooks

Use the provided option to debug Ballerina notebooks as shown below.

Tip: You need to enable the debug mode via the VS Code extension settings as shown below.