Home

Awesome

carrot.nvim license version

Markdown evaluator for Neovim Lua code blocks.

This is still work-in-progress but the main code evaluation functionnalities should be working.

The plugin will detect the code blocks under the cursor using treesitter's query mechanism, execute it, and show the results directly in the markdown.

It tries to be not intrusive. It won't redefine print() to redirect the result, it uses a subprocess neovim to evaluate the code in a sandboxed safe environnement.

It also tries to keep the spirit of Markdown files and show results in a simple but pleasing way.

carrot screenshot

Prerequisites

Make sure that the markdown parser is installed with:

local buf = vim.api.nvim_create_buf(false, true)
local parser = vim.treesitter.get_parser(buf, "markdown")
assert(parser, "The markdown parser is not installed.")
print("OK")
OK

Install

Install using your prefered method:

Plug 'jbyuki/carrot.nvim'
use "jbyuki/carrot.nvim"

Usage

Commands

Examples