0: https://code.visualstudio.com/docs/python/jupyter-support-py
0: https://code.visualstudio.com/docs/python/jupyter-support-py
[0] https://docs.spyder-ide.org/current/panes/editor.html#code-c...
# %% [markdown]
# Another Markdown cell
# %%
# This is a code cell
class A():
def one():
return 1
# %% Optional title [cell type] key="value"
MyST Markdown has: https://mystmd.org/guide/notebooks-with-markdown : ```{code-cell} LANGUAGE
:key: value
CODE TO BE EXECUTED
```
And : ---
kernelspec:
name: javascript
display_name: JavaScript
---
# Another markdown cell
```{code-cell} javascript
// This is a code cell
console.log("hello javascript kernel");
```
But also does not store the outputs in the markdown.The vim plugin I was talking about was vim-slime [0], which seems to date from 2007 and does have regions delimited with #%%.
Slime comes from Emacs originally, but I could not find if the original Emacs slime has regions.
Matlab also has those, which they call code sections [1]. Hard to find when they were introduced. Maybe 2021, but I suspect older.
None of those stores gge output of the command.
[0] https://vimawesome.com/plugin/vim-slime
[1] https://www.mathworks.com/help/matlab/matlab_prog/create-and...
# %%
"^# %%"
Org-mode was released in 2003:
https://en.wikipedia.org/wiki/Org-modeOrg-mode supports code blocks: https://orgmode.org/manual/Structure-of-Code-Blocks.html :
#+BEGIN_SRC <language> and
#+END_SRC.
Literate programming; LaTeX:
https://en.wikipedia.org/wiki/Literate_programmingNotebook interface; Markdown + MathTeX: https://en.wikipedia.org/wiki/Notebook_interface ;
$ \delta_{2 3 4} = 5 $
$$ \Delta_\text{3 4 5} = 56 $$whether or not it's better for you depends on your use case for notebooks — i use them mostly for prototyping and exploratory data analysis so separating the code from the output might be more convenient for me than for you
I wrote a small vscode extension that builds upon this to automatically infer code blocks via indentation, so that you don't have to select them manually: [0]