VSCode Extension which allows you to execute code from markdown
files.
Detects code blocks in your markdown
-files starting with:
Adds 'Execute command in terminal as Shell-Script'
, 'Execute command in terminal as NodeJs-Script'
, 'Execute command in terminal as python-Script'
label.
Clicking on the label executes code-block until the closing ticks ``` in the terminal as Shell
, NodeJs
or Python
script.
Alternatively, use cmd+f1
(mac) / ctrl+f1
(windows) shortcut to execute current selection.
Select code and either use shortcut cmd+f1
(mac) / ctrl+f1
(windows) to execute or open the VSCode command palette
and type markdown execute
to find the command:
If you interact with terminal very often, I recomment using the terminal in editor area side by side in split view.:
This extension contributes the following settings:
markdown-execute.executeInSsh
: enable/disable execution of code in a SSH session. If disabled and active terminal is running a SSH session, a new terminal is used as target for commands.markdown-execute.executeSelection
: Shortcut to execute selection. Defaults to cmd+f1
(mac) / ctrl+f1
(windows).commandCodeLensProvider
:
extension.ts
& execute.ts
:
cmd+f1 s
Execute command as Shellcmd+f1 s
Execute command with NodejsSycl´s Markdown Command Runner Extension served as inspiration. Thanks!
It was lacking execution of code blocks in active SSH sessions, shortcuts and NodeJs
-support, so I made my own.