Skip to content

VS Code notebook to execute cells in bash, JavaScript, TypeScript, Ruby, or Python.

License

Notifications You must be signed in to change notification settings

JacksonKearl/vscode-handydandy-notebook

Repository files navigation

Handy Dandy Notebook - VS Code

Execute cells in bash, JavaScript, TypeScript, Ruby, or Python.

Provides the command: New Handy Dandy Notebook to open a new untitled notebook. Also opens .hdnb files by default, and opens .md files via the View: Reopen Editor With... option.

Example of each supportted language printing hello world

How It Works

Unlike some notebook implementations, the Handy Dandy Notebook does not share any state across cells. This means each time you execute a cell, it runs in a brand new context, totally isolated from the rest of the cells.

Cells support a {{auth:github}} token which will be replaced with a github token with repo scope at time of execution.

Config

handydandy-notebook.dispatch

Used to configure how to execute cells. Array where the first element is the program to launch and second argument is array of arguments to pass. The string ${code} in a an argument will be substituted for the cell contents.

Default:

{
"python": [ "python", [ "-c", "${code}" ] ],
"typescript": [ "ts-node", [ "-T", "--skip-project", "-e", "${code}" ] ],
"javascript": [ "node", [ "-e", "(async () => { ${code} } )()" ] ],
"ruby": [ "ruby", [ "-e", "${code}" ] ],
"shellscript": [ "bash", [ "-c", "${code}" ] ],
"bash": [ "bash", [ "-c", "${code}" ] ]
}

About

VS Code notebook to execute cells in bash, JavaScript, TypeScript, Ruby, or Python.

Resources

License

Stars

Watchers

Forks