Markdown snippet runner for neovim.
- evaluate markdown codeblock in the language of your choice
- stream stdin and stdout to other codeblocks in real time
- define env-vars per markdown section
- run snippets either directly or in a docker/podman container
- define custom runners for languages not supported out of the box
require('mdrun').setup({
stop_signal = "SIGINT", -- Signal to send when attempting to stop a process. one of: [SIGKILL, SIGINT]
})Example 1:
echo "I'm in $(pwd)"I'm in /usr/share
Example 2:
Config:
| Key | Default | Description |
|---|---|---|
| CWD | Neovims current workdir | working directory of the shell commands to run |
| CONTAINER | None | Docker/podman container in which to run the shell command. |
Example 1:
one := 1
two := 2
pi := math.Pi
fmt.Printf("One plus Two is: %d\n", one + two)
fmt.Printf("Pi is: %f\n", pi)One plus Two is: 3
Pi is: 3.141593
Config:
| Key | Default | Description |
|---|---|---|
| FULL_FILE | false | Weather or not the codeblock specifies the full main.go or just the contents of the main function |
| Language | Done |
|---|---|
| Bash/Shell | Yes |
| C | Yes |
| C++ | Yes |
| C# | No |
| Clojure | No |
| Elixir | No |
| F# | No |
| Go | Yes |
| Haskell | Yes |
| Java | No |
| JavaScript | No |
| Julia | No |
| Lua | Yes |
| OCaml | No |
| Perl/Perl6 | No |
| Python3 | No |
| R | No |
| Ruby | No |
| Rust | Yes |
| Scala | No |
| TypeScript | No |
f = vim.api.nvim_get_runtime_file("*/mdrun.lua", false)
vim.print(f)
Result: <nil>