I want to "SAVE" my work -- the commands I used and the output I got -- as a "Notebook" similar to how we do for Python notebooks using Jupyter. Also add some markdown notes or links to reference material or tutorials I am following.
This allows me to revisit my work of yesterday / last month / last year and quickly review what I already "know" (or relearn quickly following the same path) and then go to next logical step.
Is there such a tool or solution?
Thanks in advance
You can save what you type with the 'script' command.
script test_session
Will save everything you type and their output to the test_session file until you exit the shell with Ctrl-DLook up "man script" for more details (funny it mentions 'typescript' but it is not that typescript)
(and while I joke about 'kids these days' I learned this from the UNIX greybeards so there's that as well)
> ipython
You can use the %save magic command to save your session, there's lots more, check the documentation to discover it.
For example, in an org doc you can have something like this:
* Python
#+BEGIN_SRC python :results output
def myTest(a):
return a + 2
print (myTest(8))
#+END_SRC
#+RESULTS:
: 10
#+BEGIN_SRC python :results output
def check_even(n):
if n % 2 == 0:
print("even")
else:
print("odd")
check_even(5)
check_even(2)
#+END_SRC
#+RESULTS:
: odd
: even
- the xonsh (a full-featured unix shell, in python) kernel with jupyter
- the acme editor, using `win` to give you a dumb terminal access to your shell (or indeed any repl). As well as being a shell/repl, you can also treat that window as a text buffer, manipulating it and saving it as such (very liberating feeling, in practice)
It sounds like exactly what you are after.
Edit: But I do not know of an integrated, comfortable way to combine asciinema and markdown. Enhancing the asciicast format with (markdown) comments and make the asciicast players display them would be nice.
I have also given it a shortcut: `Ctrl+e, e`. So I can just select something and execute it in the terminal. Works quite well.
(Inspired by a similar feature in Emacs)
Side-note: is the inverse of this available? E.g. open a jupyter notebook from in the middle of a python script