Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jbyuki/ntangle-notebook.nvim
Jupyter frontend + ntangle.nvim
https://github.com/jbyuki/ntangle-notebook.nvim
jupyter jupyter-client literate-programming neovim python
Last synced: about 1 month ago
JSON representation
Jupyter frontend + ntangle.nvim
- Host: GitHub
- URL: https://github.com/jbyuki/ntangle-notebook.nvim
- Owner: jbyuki
- License: mit
- Created: 2022-06-26T13:41:31.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-08-05T20:20:59.000Z (4 months ago)
- Last Synced: 2024-08-06T21:36:43.713Z (3 months ago)
- Topics: jupyter, jupyter-client, literate-programming, neovim, python
- Language: Lua
- Homepage:
- Size: 51.8 KB
- Stars: 6
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# ntangle-notebook.nvim
Jupyter frontend for literate python files.
![](https://github.com/jbyuki/gifs/blob/main/jupyternotebook.png)
Main Features
-------------* No external dependencies
* Multiple kernel support
* Visual range execution
Requirements
------------* [ntangle-inc.nvim](https://github.com/jbyuki/ntangle-inc.nvim)
* [Jupyter notebook](https://jupyter.org/install) (`jupyter lab` is recommended)> [!WARNING]
> Full support only for ntangle v2 (`*py.t2` files)Configuration
-------------### Keybindings
```lua
vim.api.nvim_create_autocmd({"BufRead", "BufNew"}, {
pattern = { "*.py.t2" },
callback = function(ev)
local opts = { buffer = ev.buf, silent=true }
vim.keymap.set("n", "r", function()
require"ntangle-notebook".send_ntangle_v2()
end, opts)vim.keymap.set('v', 'r', ":SendNTangleV2", opts)
end
})
```### Runtime dir
Set the runtime directory. It can be found by running `jupyter --runtime-dir` or `python -m jupyter --runtime-dir`.
```lua
vim.g.ntangle_notebook_runtime_dir = "..."
```Usage
------ Start jupyter and open a console
- Right-click anywhere in console > Show All Kernel Activity
- Execute `:lua require"ntangle-notebook".connect()`
- Choose a kernel if multiple are proposed- Open a `*.py.t2` file and execute code by:
- In normal mode: Press `r`.
- In visual mode: Select a region and `r`.