ivanov/vim-ipython

Interacting with a markdown representation of IPython notebooks

aaren opened this issue · 0 comments

This is more of a brainstorm than an issue and I'd be interested to hear any thoughts.

I've been working on notedown recently and have got to the point where you can interchange between markdown and json representations of the notebook (including outputs)

You can create a notebook in the browser, play around and create some outputs, then convert that notebook to markdown, fiddle around in vim and convert back to .ipynb.

The basic markdown format for cells is this:

This is regular *markdown*. With [links](to/things) 
and whatever. Code cells look like this:    

```{.python .input n=1}
some code
```

```{.json .output n=1}
json serialization of the outputs
```

i.e. two consecutive fenced code blocks with attributes. 
The output cell is optional.

i.e. using pandoc style code attributes. If don't give output cells, then you can use the notedown --run flag to pass the markdown through runipy and generate the outputs.

My idea is to use this markdown representation as an interactive environment. e.g If your cursor is within an input code block and you hit Shift-Enter, then you take the code in the input cell and pass it to the kernel client. Then if your code makes a plot, this gets displayed in a separate window.

You could also use runipy to generate an output cell which is appended after the input cell.

This way you could create valid notebooks with outputs without ever leaving vim.