mirror of
https://github.com/Hopiu/lychee.git
synced 2026-03-29 10:50:24 +00:00
This is taken from https://github.com/sharkdp/fd, so all credits go to the original authors. The demo was a bit dated. We've since added more features and changed the output. On top of that, the gif was a bit blurry. The new version is in SVG and the commands can be scripted, so we can change them with a PR and render them through CI. Co-authored-by: Brennan Kinney <5098581+polarathene@users.noreply.github.com>
60 lines
No EOL
1.1 KiB
Bash
60 lines
No EOL
1.1 KiB
Bash
#!/usr/bin/env bash
|
||
#
|
||
# Adapted from
|
||
# https://github.com/marionebl/svg-term-cli
|
||
# https://github.com/sharkdp/fd/blob/master/doc/screencast.sh
|
||
#
|
||
# Designed to be executed via svg-term from the lychee root directory:
|
||
# svg-term --command="bash assets/screencast.sh" --out assets/screencast.svg --padding=10
|
||
# Then run this (workaround for https://github.com/sharkdp/fd/issues/1003):
|
||
# sed -i '' 's/<text/<text font-size="1.67"/g' assets/screencast.svg
|
||
set -e
|
||
set -u
|
||
|
||
PROMPT="❯"
|
||
|
||
# Always use latest version of lychee for screencast
|
||
alias lychee="cargo run --"
|
||
|
||
enter() {
|
||
INPUT=$1
|
||
DELAY=1
|
||
|
||
prompt
|
||
sleep "$DELAY"
|
||
type "$INPUT"
|
||
sleep 0.5
|
||
printf '%b' "\\n"
|
||
eval "$INPUT"
|
||
type "\\n"
|
||
}
|
||
|
||
prompt() {
|
||
printf '%b ' "$PROMPT" | pv -q
|
||
}
|
||
|
||
type() {
|
||
printf '%b' "$1" | pv -qL $((10+(-2 + RANDOM%5)))
|
||
}
|
||
|
||
main() {
|
||
IFS='%'
|
||
|
||
enter "lychee README.md"
|
||
|
||
enter "lychee --verbose --format=json fixtures/TEST.html"
|
||
|
||
enter "lychee --no-progress --format detailed https://example.com"
|
||
|
||
enter "lychee --dump --include github -- './**/*.md'"
|
||
|
||
prompt
|
||
|
||
sleep 3
|
||
|
||
echo ""
|
||
|
||
unset IFS
|
||
}
|
||
|
||
main |