cat / 012
clone

a spreadsheet for the terminal: lotus 1-2-3 looks, google sheets keys and formulas, one go binary

main
012 / demos / notebook.tape
notebook.tape 1.5K
1# Notebooks: 012 nu opens a notebook, its first cell ready to type in.2# A code cell reads a CSV as sales, a second reads it as $sales, and its3# output, entered with Enter, is a grid to select in, and goes to a4# sheet (G) where a formula sums it; with the notebook5# reactive, editing sales runs both again and the sheet follows. The terminal (ttyd) sends Shift+Enter as Enter, so6# cells run with Esc then r. Needs nu on the PATH.7Output out/notebook.gif8Source lib/setup.tape9Set Theme "tokyonight"1011Hide12Type "../bin/012 nu" Enter13Sleep 2s14Show1516Sleep 800ms17Type@15ms "sales = open data/sales.csv | where Region in [North South] | select Region Quarter Units"18Sleep 500ms19Escape20Type "r"21Sleep 1s22Type "b"23Enter24Type@15ms "top = $sales | where Units > 250 | sort-by Units --reverse"25Sleep 500ms26Escape27Type "r"28Sleep 2s29Screenshot out/stills/notebook-cells.png30Down31Enter32Sleep 400ms33Ctrl+Shift+Down34Sleep 1s35Screenshot out/stills/notebook-grid.png36Escape Escape37Sleep 500ms38Type "G"39Sleep 800ms40Enter41Sleep 1.2s42Ctrl+K43Type@20ms "next sh"44Sleep 500ms45Enter46Sleep 400ms47Right Right Right Right48Type "=SUM(nu.top)" Enter49Sleep 1s50Screenshot out/stills/notebook-sent.png51Ctrl+K52Type@20ms "previous sh"53Sleep 500ms54Enter55Sleep 400ms56Ctrl+K57Type@20ms "reacti"58Sleep 400ms59Enter60Sleep 400ms61Up Up Up62Sleep 300ms63Enter64Type@20ms " | where Quarter != Q1"65Escape66Type "r"67Sleep 2s68Screenshot out/stills/notebook-reactive.png69Ctrl+K70Type@20ms "next sh"71Sleep 500ms72Enter73Sleep 2s74Screenshot out/stills/notebook-sum.png