cursive
cursive copied to clipboard
[FEATURE] Gif previews for examples
I noticed that I frequently launch random examples just to see whether there is something that might fit my task. I guess I'm not the only one. Just looking at all(most?) examples on one page in the form of a list of gifs would seem like a huge timesaver.
Describe the solution you'd like
-
Generate gifs for all existing examples(I use asciinema) and save them somewhere in the repository
-
Update cursive/examples/Readme.md to display those gifs as embedded images next to each example name
Pending questions
-
where do you think such gifs should be present? /cursive/examples/assets/ ? /cursive/examples/previews/ ?
-
Any gif generating agg config that might be necessary for the final version? For the attached gifs I used the following config
agg --theme solarized-dark --idle-time-limit 1 --fps-cap 3 "$1.cast" "$1.gif"
Reduced fps-cap just to keep the size of those files smaller.
- Does the dimensions of those attached gifs look fine? The idea was to make it smaller and accessible from smaller devices.
Gif previews sounds like a great idea!
I would possibly aim for smaller pictures, so it's not too overwhelming when opening Readme.
I'd also look into storing the gif themselves in github LFS (should be far below the 1GB quota?), and cursive/examples/assets
is a fine place for that.
I would also look into generating/updating these examples automatically. Maybe store in the same assets folders timed inputs for each example, and a script to replay these input and save the result in asciinema, before converting it to gifs.
My old record project might help there, though it doesn't seem to work at the moment (not sure how much work it'd take to fix it). Will look at alternatives.
@gyscos Maybe checkout https://github.com/charmbracelet/vhs ?