From 1259a74e4636497a4af37885fd91c0dcd0292612 Mon Sep 17 00:00:00 2001 From: Thomas Churchman Date: Sat, 29 Jun 2024 13:44:43 +0200 Subject: [PATCH] docs(README): add Tokei example --- README.md | 6 ++++++ flake.nix | 3 +++ media/tokei.svg | 32 ++++++++++++++++++++++++++++++++ scripts/examples.sh | 1 + 4 files changed, 42 insertions(+) create mode 100644 media/tokei.svg diff --git a/README.md b/README.md index d87f3b2..cc67664 100644 --- a/README.md +++ b/README.md @@ -69,6 +69,12 @@ $ ( ![Termsnap output of some tty commands](./media/tty.svg) +```bash +$ termsnap -o ./media/tokei.svg -l 22 -c 80 -- tokei +``` + +![Termsnap output of the Tokei lines of code counter](./media/tokei.svg) + ## Installation Install using Cargo: diff --git a/flake.nix b/flake.nix index c99cb31..9992fe2 100644 --- a/flake.nix +++ b/flake.nix @@ -24,7 +24,10 @@ rustc rustfmt bashInteractive + + # Programs for Termsnap examples cowsay + tokei ]; }; } diff --git a/media/tokei.svg b/media/tokei.svg new file mode 100644 index 0000000..de43cfa --- /dev/null +++ b/media/tokei.svg @@ -0,0 +1,32 @@ + + + + +=============================================================================== +Language            Files        Lines         Code     Comments       Blanks +=============================================================================== +Nix                     2           46           44            1            1 +Python                  1            4            2            1            1 +Shell                   1           33           22            2            9 +SVG                     5          350          345            0            5 +Plain Text              1           12            0           12            0 +TOML                    3           85           74            2            9 +------------------------------------------------------------------------------- +Markdown                3          121            0           76           45 +|- BASH                 1           19            9            6            4 +(Total)                            140            9           82           49 +------------------------------------------------------------------------------- +Rust                    5         1317         1152           20          145 +|- Markdown             5           65            0           57            8 +(Total)                           1382         1152           77          153 +=============================================================================== +Total                  21         1968         1639          114          215 +=============================================================================== + + + \ No newline at end of file diff --git a/scripts/examples.sh b/scripts/examples.sh index 96be45b..71ff10a 100755 --- a/scripts/examples.sh +++ b/scripts/examples.sh @@ -10,6 +10,7 @@ export PATH="$PWD/target/release":$PATH termsnap -o ./media/cow.svg -l 9 -c 28 -- cowsay Hello, world +termsnap -o ./media/tokei.svg -l 22 -c 80 -- tokei ( # `sleep` gives bash time to be ready for the command, if this is omitted