From ff110f08292ee28edb148cbacc927b1a03d722cb Mon Sep 17 00:00:00 2001 From: Daylin Morgan Date: Wed, 8 Mar 2023 03:28:07 -0600 Subject: [PATCH] docs: make more vhs tapes --- Makefile | 6 ++++-- docs/demo.py | 11 +++++++++++ docs/demo.tape | 8 ++++---- docs/freeze.tape | 2 +- docs/list-info-rm.tape | 30 ++++++++++++++++++++++++++++++ 5 files changed, 50 insertions(+), 7 deletions(-) create mode 100644 docs/demo.py create mode 100644 docs/list-info-rm.tape diff --git a/Makefile b/Makefile index 640310e..3bad079 100644 --- a/Makefile +++ b/Makefile @@ -22,11 +22,13 @@ install: ## symlink to $PREFIX uninstall: ## delete $(PREFIX)/viv rm $(PREFIX)/viv -docs: docs/demo.gif docs/freeze.gif ## generate usage examples +TAPES = demo freeze list-info-rm +GIFS := $(foreach n, $(TAPES), docs/$(n).gif) +docs: $(GIFS) ## generate usage examples docs/%.gif: docs/%.tape viv rm $$(viv l -q) - vhs < $< + cd docs; vhs < $*.tape clean: ## remove build artifacts rm -rf {build,dist} diff --git a/docs/demo.py b/docs/demo.py new file mode 100644 index 0000000..27819e8 --- /dev/null +++ b/docs/demo.py @@ -0,0 +1,11 @@ +#!/usr/bin/env python3 + +__import__("viv").activate("pyfiglet==0.8.post1") # noqa + +from pyfiglet import Figlet + +if __name__ == "__main__": + f = Figlet(font="slant") + figtxt = f.renderText("viv").splitlines() + figtxt[-2] += " isn't venv!" + print("\n".join(figtxt)) diff --git a/docs/demo.tape b/docs/demo.tape index b56f690..5ea92ec 100644 --- a/docs/demo.tape +++ b/docs/demo.tape @@ -1,12 +1,12 @@ Set Height 750 Set Width 1500 Set Theme "Catppuccin Mocha" -Output ./docs/demo.gif +Output ./demo.gif Type "viv list" Enter Sleep 2s -Type "python examples/cli.py --help" +Type "python ../examples/cli.py --help" Enter Sleep 10s Type "viv list" @@ -15,9 +15,9 @@ Sleep 3s Type "viv info 841" Enter Sleep 3s -Type "python examples/cli.py hello 'prospective viv user!'" +Type "python ../examples/cli.py hello 'prospective viv user!'" Enter Sleep 2s -Type "python examples/cli.py goodbye 'prospective viv user!'" +Type "python ../examples/cli.py goodbye 'prospective viv user!'" Enter Sleep 2s diff --git a/docs/freeze.tape b/docs/freeze.tape index 64f2a19..38eaa7e 100644 --- a/docs/freeze.tape +++ b/docs/freeze.tape @@ -1,7 +1,7 @@ Set Height 750 Set Width 1500 Set Theme "Catppuccin Mocha" -Output ./docs/freeze.gif +Output ./freeze.gif Type "viv freeze --help" Enter diff --git a/docs/list-info-rm.tape b/docs/list-info-rm.tape new file mode 100644 index 0000000..322ac08 --- /dev/null +++ b/docs/list-info-rm.tape @@ -0,0 +1,30 @@ +Set Height 750 +Set Width 1500 +Set Theme "Catppuccin Mocha" +Output ./list-info-rm.gif + +Type "cat demo.py" +Enter +Sleep 500ms +Type "python demo.py" +Enter +Sleep 3s +Type "viv list -h" +Enter +Sleep 500ms +Type "viv list -q" +Enter +Sleep 1s +Type "viv info -h" +Enter +Sleep 500ms +Type "viv info " +Sleep 1s +Type "f8" +Enter +Sleep 1s +Type "viv remove -h" +Enter +Type "viv rm f8" +Enter +Sleep 2s