Skip to content

Detect language attached to myst-notebook's code cells in neovim

License

Notifications You must be signed in to change notification settings

sondalex/mystnb.nvim

Repository files navigation

mystnb.nvim

Detect language attached to myst-notebook's code cells in neovim.

Example

Without mystnb.nvim

With mystnb.nvim

Installation

With packer:

use({
    "sondalex/mystnb.nvim",
    config = function()
    require("mystnb").setup()
    end
})

Settings

Default settings

{
lookup = { ipython3 = "python", ipython = "python" }
}

Lookup associates a specific keyword to a treesitter language.

Example:

This cell is associated to python

```{code-cell} python 
import math
```

mystnb also detects language if you provide a file extension. Example:

```{code-cell} py
import math
```



```{code-cell} jl
using DataFrame
DataFrame(
    "product identifier" => [15, 20, 25],
    "product name" => ["Apple", "Pear", "Peach"]
)
```

Testing (Unix based only)

./tests/run

About

Detect language attached to myst-notebook's code cells in neovim

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages