feat(shortcode): add shortcode for asciinema (#779)

* Add asciinema shortcode and usage examples

* Add asciinema shortcode

* Modify

* Modify

* Modify

* Modify

* Modify

* Remove old blog post and move content to dedicated documentation

* Add remote cast file support

* Fix remote cast file support

* Modify asciinema guide

* Add asciinema controls and idleTimeLimit

* fix the play button position issue and update some details

* Remove forced /casts/ prefix, implement flexible file lookup
This commit is contained in:
Lamber
2025-08-25 15:50:53 +08:00
committed by GitHub
parent fee0481a6c
commit 524af14bd1
13 changed files with 716 additions and 0 deletions

19
static/casts/demo.cast Normal file
View File

@@ -0,0 +1,19 @@
{"version": 2, "width": 80, "height": 24, "timestamp": 1640995200, "env": {"TERM": "xterm-256color", "SHELL": "/bin/bash"}, "title": "Demo Terminal Session"}
[0.0, "o", "Welcome to the demo!\r\n"]
[1.0, "o", "$ "]
[2.0, "o", "ls -la\r\n"]
[2.5, "o", "total 8\r\n"]
[2.6, "o", "drwxr-xr-x 2 user user 4096 Jan 1 12:00 .\r\n"]
[2.7, "o", "drwxr-xr-x 20 user user 4096 Jan 1 12:00 ..\r\n"]
[2.8, "o", "-rw-r--r-- 1 user user 0 Jan 1 12:00 demo.txt\r\n"]
[3.0, "o", "$ "]
[4.0, "o", "cat demo.txt\r\n"]
[4.5, "o", "Hello, this is a demo file!\r\n"]
[5.0, "o", "$ "]
[6.0, "o", "echo 'This is a test command'\r\n"]
[6.5, "o", "This is a test command\r\n"]
[7.0, "o", "$ "]
[8.0, "o", "pwd\r\n"]
[8.5, "o", "/home/user/demo\r\n"]
[9.0, "o", "$ "]
[10.0, "o", "exit\r\n"]