From bbb58c3804203c5c7074e5c0f4f402bbbbe4bcc6 Mon Sep 17 00:00:00 2001 From: Simon Michael Date: Fri, 17 Mar 2023 00:09:24 -1000 Subject: [PATCH] imp: demo: Watching the built-in demos (demo) --- hledger/Hledger/Cli/Commands/Demo.hs | 11 +- hledger/embeddedfiles/demo.cast | 267 +++++++++++++++++++++++++++ 2 files changed, 273 insertions(+), 5 deletions(-) create mode 100644 hledger/embeddedfiles/demo.cast diff --git a/hledger/Hledger/Cli/Commands/Demo.hs b/hledger/Hledger/Cli/Commands/Demo.hs index f83782b90..9c5840b8d 100644 --- a/hledger/Hledger/Cli/Commands/Demo.hs +++ b/hledger/Hledger/Cli/Commands/Demo.hs @@ -35,10 +35,11 @@ data Demo = Demo { demos :: [Demo] demos = map readDemo [ - $(embedFileRelative "embeddedfiles/install.cast") - ,$(embedFileRelative "embeddedfiles/add.cast") - ,$(embedFileRelative "embeddedfiles/print.cast") - ,$(embedFileRelative "embeddedfiles/balance.cast") + $(embedFileRelative "embeddedfiles/install.cast") -- https://asciinema.org/a/567934 + ,$(embedFileRelative "embeddedfiles/demo.cast") -- https://asciinema.org/a/567944 + ,$(embedFileRelative "embeddedfiles/add.cast") -- https://asciinema.org/a/567935 + ,$(embedFileRelative "embeddedfiles/print.cast") -- https://asciinema.org/a/567936 + ,$(embedFileRelative "embeddedfiles/balance.cast") -- https://asciinema.org/a/567937 ] -- | Command line options for this command. @@ -92,7 +93,7 @@ findDemo ds s = sl = lowercase s printDemos :: IO () -printDemos = putStr $ unlines $ +printDemos = putStrLn $ unlines $ "Demos:" : -- "" : [show i <> ") " <> t | (i, Demo t _) <- zip [(1::Int)..] demos] diff --git a/hledger/embeddedfiles/demo.cast b/hledger/embeddedfiles/demo.cast new file mode 100644 index 000000000..36091cab3 --- /dev/null +++ b/hledger/embeddedfiles/demo.cast @@ -0,0 +1,267 @@ +{"version": 2, "width": 80, "height": 25, "timestamp": 1679047443, "env": {"SHELL": "/opt/homebrew/bin/bash", "TERM": "xterm-256color"}, "title": "Watching the built-in demos (demo)"} +[0.176603, "o", "\u001b[?2004h$ "] +[1.310863, "o", "h"] +[1.353474, "o", "l"] +[1.44748, "o", "e"] +[1.61929, "o", "d"] +[1.74949, "o", "g"] +[1.898693, "o", "e"] +[1.977291, "o", "r"] +[2.063266, "o", " "] +[2.180935, "o", "d"] +[2.37568, "o", "e"] +[2.447958, "o", "m"] +[2.499957, "o", "o"] +[2.832753, "o", "\r\n"] +[2.83284, "o", "\u001b[?2004l\r"] +[2.95719, "o", "Usage: hledger demo [NUM|PREFIX|SUBSTR] [-- ASCIINEMAOPTS]\r\nDemos:\r\n1) Installing hledger tools from source (hledger-install.sh)\r\n2) The simplest way to start (add)\r\n"] +[2.957216, "o", "3) Showing journal entries (print)\r\n4) Showing account balances (balance)\r\n\r\n"] +[2.962769, "o", "\u001b[?2004h$ "] +[5.394264, "o", "h"] +[5.434945, "o", "l"] +[5.56741, "o", "e"] +[5.755843, "o", "d"] +[5.901877, "o", "g"] +[6.094957, "o", "e"] +[6.152431, "o", "r"] +[6.343766, "o", " "] +[6.518546, "o", "d"] +[6.713268, "o", "e"] +[6.845525, "o", "m"] +[6.91132, "o", "o"] +[7.348159, "o", " "] +[8.297081, "o", "3"] +[9.903795, "o", "\r\n"] +[9.904033, "o", "\u001b[?2004l\r"] +[9.956173, "o", "playing (space to pause, . to step, ctrl-c to quit):\r\n Showing journal entries (print)\r\n"] +[10.957853, "o", "\r\n"] +[11.519628, "o", "\u001b[?2004h~$ "] +[12.018884, "o", "h"] +[12.110337, "o", "l"] +[12.226196, "o", "e"] +[12.371726, "o", "d"] +[12.465827, "o", "g"] +[12.615678, "o", "e"] +[12.712466, "o", "r"] +[12.843013, "o", " "] +[13.035823, "o", "p"] +[13.184367, "o", "r"] +[13.274482, "o", "i"] +[13.330824, "o", "n"] +[13.420826, "o", "t"] +[13.877201, "o", " "] +[14.066291, "o", " "] +[14.245804, "o", " "] +[14.43335, "o", "#"] +[14.698342, "o", " "] +[15.14466, "o", "s"] +[15.267259, "o", "h"] +[15.326365, "o", "o"] +[15.413722, "o", "w"] +[15.541189, "o", " "] +[16.044458, "o", "t"] +[16.110011, "o", "r"] +[16.199637, "o", "a"] +[16.314888, "o", "n"] +[16.415289, "o", "s"] +[16.501679, "o", "a"] +[16.593963, "o", "c"] +[16.801852, "o", "t"] +[16.895649, "o", "i"] +[16.923267, "o", "o"] +[16.990561, "o", "n"] +[17.051797, "o", "s"] +[17.54797, "o", "\r\n"] +[17.548141, "o", "\u001b[?2004l\r"] +[17.731111, "o", "2023-03-15 opening balances\r\n cash $50.25\r\n equity $-50.25\r\n\r\n"] +[17.774905, "o", "\u001b[?2004h$ "] +[19.359413, "o", "h"] +[19.429319, "o", "l"] +[19.530389, "o", "e"] +[19.724544, "o", "d"] +[19.847953, "o", "g"] +[20.048792, "o", "e"] +[20.089497, "o", "r"] +[20.267404, "o", " "] +[20.623864, "o", "d"] +[20.830371, "o", "e"] +[20.933611, "o", "m"] +[20.997097, "o", "o"] +[21.144923, "o", " "] +[21.326446, "o", "3"] +[21.498718, "o", " "] +[22.926537, "o", "-"] +[23.093133, "o", "-"] +[23.479314, "o", " "] +[23.680808, "o", "-"] +[24.043799, "o", "s"] +[24.79515, "o", "8"] +[25.49309, "o", "\r\n"] +[25.493426, "o", "\u001b[?2004l\r"] +[25.546164, "o", "playing (space to pause, . to step, ctrl-c to quit):\r\n Showing journal entries (print)\r\n"] +[26.547675, "o", "\r\n"] +[26.704606, "o", "\u001b[?2004h~$ "] +[26.767594, "o", "h"] +[26.775481, "o", "l"] +[26.791626, "o", "e"] +[26.810587, "o", "d"] +[26.820436, "o", "g"] +[26.840975, "o", "e"] +[26.851274, "o", "r"] +[26.867843, "o", " "] +[26.893419, "o", "p"] +[26.911923, "o", "r"] +[26.921332, "o", "i"] +[26.927952, "o", "n"] +[26.940169, "o", "t"] +[26.999437, "o", " "] +[27.023517, "o", " "] +[27.04522, "o", " "] +[27.069185, "o", "#"] +[27.102893, "o", " "] +[27.158712, "o", "s"] +[27.171396, "o", "h"] +[27.177185, "o", "o"] +[27.189369, "o", "w"] +[27.204473, "o", " "] +[27.27078, "o", "t"] +[27.274695, "o", "r"] +[27.287579, "o", "a"] +[27.302827, "o", "n"] +[27.313501, "o", "s"] +[27.325205, "o", "a"] +[27.335837, "o", "c"] +[27.36182, "o", "t"] +[27.374663, "o", "i"] +[27.376217, "o", "o"] +[27.386026, "o", "n"] +[27.392988, "o", "s"] +[27.459178, "o", "\r\n"] +[27.459413, "o", "\u001b[?2004l\r"] +[27.480224, "o", "2023-03-15 opening balances\r\n cash $50.25\r\n equity $-50.25\r\n\r\n"] +[27.518421, "o", "\u001b[?2004h$ "] +[29.565023, "o", "hledger demo 3 -- -s8"] +[30.304993, "o", "\b"] +[30.553837, "o", "\b"] +[30.58526, "o", "\b"] +[30.620253, "o", "\b"] +[30.655032, "o", "\b"] +[30.689063, "o", "\b"] +[30.723603, "o", "\b"] +[31.160961, "o", "\b"] +[31.378202, "o", "\u001b[1P"] +[33.013203, "o", "\u001b[1@b"] +[33.112495, "o", "\u001b[1@a"] +[33.236567, "o", "\u001b[1@l"] +[33.327091, "o", "\u001b[1@a"] +[33.414089, "o", "\u001b[1@n"] +[33.515235, "o", "\u001b[1@c"] +[33.617473, "o", "\u001b[1@e"] +[34.025797, "o", "\u001b[H\u001b[2J$ hledger demo balance -- -s8\b\b\b\b\b\b\b"] +[34.479562, "o", "\u001b[C\u001b[C\u001b[C\u001b[C\u001b[C\u001b[C\u001b[C"] +[35.258258, "o", "\b\u001b[K"] +[35.494754, "o", "1"] +[35.600772, "o", "0"] +[35.9397, "o", "\r\n"] +[35.939937, "o", "\u001b[?2004l\r"] +[35.992348, "o", "playing (space to pause, . to step, ctrl-c to quit):\r\n Showing account balances (balance)\r\n"] +[36.994594, "o", "\r\n"] +[37.133719, "o", "\u001b[?2004h~$ "] +[37.183698, "o", "h"] +[37.186015, "o", "l"] +[37.191903, "o", "e"] +[37.210473, "o", "d"] +[37.215752, "o", "g"] +[37.233901, "o", "e"] +[37.240247, "o", "r"] +[37.255343, "o", " "] +[37.285068, "o", "b"] +[37.293878, "o", "a"] +[37.304469, "o", "l"] +[37.316581, "o", "a"] +[37.327248, "o", "n"] +[37.335872, "o", "c"] +[37.345838, "o", "e"] +[37.389734, "o", " "] +[37.403583, "o", " "] +[37.422414, "o", " "] +[37.435355, "o", "#"] +[37.468569, "o", " "] +[37.510255, "o", "s"] +[37.510962, "o", "h"] +[37.518756, "o", "o"] +[37.529555, "o", "w"] +[37.537385, "o", " "] +[37.549674, "o", "a"] +[37.558304, "o", "c"] +[37.575554, "o", "c"] +[37.580127, "o", "o"] +[37.585827, "o", "u"] +[37.608957, "o", "n"] +[37.6129, "o", "t"] +[37.625157, "o", " "] +[37.648619, "o", "b"] +[37.653142, "o", "a"] +[37.669248, "o", "l"] +[37.672693, "o", "a"] +[37.687693, "o", "n"] +[37.696821, "o", "c"] +[37.705926, "o", "e"] +[37.714785, "o", "s"] +[37.768037, "o", "\r\n"] +[37.768181, "o", "\u001b[?2004l\r"] +[37.768552, "o", " $50.25 cash\r\n \u001b[31m$-50.25\u001b[m equity\r\n--------------------\r\n 0 \r\n"] +[37.769394, "o", "\u001b[?2004h~$ "] +[37.820507, "o", "h"] +[37.83045, "o", "l"] +[37.834252, "o", "e"] +[37.852151, "o", "d"] +[37.866353, "o", "g"] +[37.881275, "o", "e"] +[37.889209, "o", "r"] +[37.90098, "o", " "] +[37.930347, "o", "b"] +[37.932075, "o", "a"] +[37.945702, "o", "l"] +[37.954144, "o", "a"] +[37.965918, "o", "n"] +[37.974373, "o", "c"] +[37.986128, "o", "e"] +[37.995588, "o", " "] +[38.027401, "o", "c"] +[38.033783, "o", "a"] +[38.047147, "o", "s"] +[38.063364, "o", "h"] +[38.102598, "o", " "] +[38.117006, "o", " "] +[38.13576, "o", " "] +[38.171729, "o", "#"] +[38.19904, "o", " "] +[38.211345, "o", "s"] +[38.221068, "o", "h"] +[38.226583, "o", "o"] +[38.235583, "o", "w"] +[38.244174, "o", " "] +[38.260854, "o", "j"] +[38.2808, "o", "u"] +[38.282689, "o", "s"] +[38.293952, "o", "t"] +[38.29973, "o", " "] +[38.31677, "o", "c"] +[38.327176, "o", "a"] +[38.336259, "o", "s"] +[38.356519, "o", "h"] +[38.366625, "o", " "] +[38.381061, "o", "a"] +[38.390158, "o", "c"] +[38.406511, "o", "c"] +[38.411513, "o", "o"] +[38.414641, "o", "u"] +[38.438547, "o", "n"] +[38.447333, "o", "t"] +[38.500701, "o", "\r\n"] +[38.500881, "o", "\u001b[?2004l\r"] +[38.510999, "o", " $50.25 cash\r\n--------------------\r\n $50.25 \r\n"] +[38.545263, "o", "\u001b[?2004h$ "] +[41.803082, "o", "\u001b[?2004l\r\r\n"] +[41.803223, "o", "exit\r\n"]