chore(kb): dump findings on how to record a terminal for technical demos

This commit is contained in:
Michele Cereda
2024-05-04 00:35:05 +02:00
parent 0b39c76548
commit df20fce076
6 changed files with 133 additions and 1 deletions

19
examples/demo.tape Normal file
View File

@@ -0,0 +1,19 @@
# Where should we write the GIF?
Output demo.gif
# Set up a 1200x600 terminal with 46px font.
Set FontSize 46
Set Width 1200
Set Height 600
# Type a command in the terminal.
Type "echo 'Welcome to VHS!'"
# Pause for dramatic effect...
Sleep 500ms
# Run the command by pressing enter.
Enter
# Admire the output for a bit.
Sleep 5s

View File

@@ -21,6 +21,7 @@ agg --rows '48' --speed '1.25' --renderer resvg --no-loop 'in.cast' 'out.gif'
## Further readings
- [Asciinema] to record terminal sessions
- [VHS] as an alternative to Asciinema
<!--
References
@@ -28,3 +29,4 @@ agg --rows '48' --speed '1.25' --renderer resvg --no-loop 'in.cast' 'out.gif'
<!-- Knowledge base -->
[asciinema]: asciinema.md
[vhs]: vhs.md

View File

@@ -19,7 +19,9 @@ python3 -m 'pip' install --user 'asciinema'
# Record sessions locally.
asciinema rec 'path/to/file.cast'
asciinema rec -i 2 'path/to/file.cast' -t 'title' --overwrite -c 'command'
asciinema rec -i '2' 'path/to/file.cast' -t 'title' --overwrite -c 'command'
asciinema rec --idle-time-limit '2' 'path/to/file.cast' --title 'title' --overwrite --cols '120' --command 'fish -l'
# Record sessions *and* upload them to the website.
asciinema rec
@@ -31,11 +33,17 @@ asciinema play 'path/to/file.cast'
asciinema upload 'path/to/file.cast'
```
```sh
asciinema rec -i '2' 'demo.cast' -t 'demo' --overwrite -c 'make demo' \
&& agg --cols '160' --rows '24' --speed '1.25' --renderer 'resvg' --no-loop 'demo.cast' 'demo.gif' --theme 'solarized-dark'
```
## Further readings
- [Website]
- [Github]
- [`agg`][agg] to convert cast files into GIFs
- [VHS] as an alternative
<!--
References
@@ -47,3 +55,4 @@ asciinema upload 'path/to/file.cast'
<!-- Knowledge base -->
[agg]: agg.md
[vhs]: vhs.md

60
knowledge base/vhs.md Normal file
View File

@@ -0,0 +1,60 @@
# VHS
1. [TL;DR](#tldr)
1. [Further readings](#further-readings)
1. [Sources](#sources)
## TL;DR
<details>
<summary>Installation and configuration</summary>
```sh
brew install 'vhs'
docker pull 'ghcr.io/charmbracelet/vhs'
```
</details>
<details>
<summary>Usage</summary>
```sh
# Check the manual.
vhs manual
# Create new recording files.
vhs new 'demo.tape'
# Process the recording.
vhs 'demo.tape'
```
</details>
<!-- Uncomment if needed
<details>
<summary>Real world use cases</summary>
</details>
-->
## Further readings
- [Github]
- [Examples]
### Sources
<!--
Reference
═╬═Time══
-->
<!-- In-article sections -->
<!-- Knowledge base -->
<!-- Files -->
<!-- Upstream -->
[github]: https://github.com/charmbracelet/vhs
[examples]: https://github.com/charmbracelet/vhs/tree/main/examples
<!-- Others -->

View File

42
knowledge base/ydotool.md Normal file
View File

@@ -0,0 +1,42 @@
# `Ydotool`
Generic Linux command-line automation tool.
1. [TL;DR](#tldr)
1. [Further readings](#further-readings)
1. [Sources](#sources)
## TL;DR
<!-- Uncomment if needed
<details>
<summary>Installation and configuration</summary>
</details>
-->
<!-- Uncomment if needed
<details>
<summary>Usage</summary>
</details>
-->
<!-- Uncomment if needed
<details>
<summary>Real world use cases</summary>
</details>
-->
## Further readings
### Sources
<!--
Reference
═╬═Time══
-->
<!-- In-article sections -->
<!-- Knowledge base -->
<!-- Files -->
<!-- Upstream -->
<!-- Others -->