如何使用脚本编写自动化来记录辅助影像记录? [英] How can I use scripting automation to record asciinema recordings?

查看:59
本文介绍了如何使用脚本编写自动化来记录辅助影像记录?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不想编写自己的按键来创建一个asciinema教程,而是编写脚本,因此我可以随着时间的流逝轻松地改进自己的教程,而不必每次都要进行更改或花费大量精力时就重做试图纠正录音中的错字的时间.

Instead of recording my own keystrokes to create an asciinema tutorial I do want to script them, so I can easily improve my tutorial over time without being being stressed about redoing it each time I want to make a change, or spending a lot of time trying to correct typos in the recording.

主要是我希望能够做些类似的事情:

Mainly I want to be able to do somethign like:

type: "df"
wait: 2s
type: "echo foo"

这使我可以在更改脚本时轻松地从头开始重建录音.

This would enable me to easily rebuild the recording from scratch when I change the script.

我该怎么做?

推荐答案

我已经为自己的项目搜索了很多解决方案,而这正是我想出的解决方案:

I've searched for a lot of solutions for my own projects, and this is the solution that I've come up with:

我打算为参与的项目做的事情是同时使用asciinema和 demo-magic.sh .

What I'm planning on doing for a project I'm in is to use both asciinema as well as demo-magic.sh.

具体来说,我将使用带有 -c 标志的asciinema进行录制(请参见.请参阅项目以了解正确的用法.

Specifically, I'll be using asciinema for the recording with the -c flag (see here), and demo-magic.sh for the automated typing, since it supports waiting for commands to finish executing (or not) and custom wait times on top of that. The command would look something like asciinema rec -c "./mydemoscript.sh" myrecording. See the projects for proper usage.

doitlive -我不使用它,因为它更像是假冒的打字自动化的东西,实际上您必须像疯子一样打字",如果您要在听众面前讲话但又不想弄乱击键,或者不想让他们打字,这可能会很有用忘记执行某些命令.

doitlive -- I'm not using this because it's more of a fake-typing automated thing where you actually have to "type like a madman", which could be useful if you're doing a talk in front of an audience but you don't want to mess up your keystrokes, or if you don't want to forget to do certain commands.

asciiscript -它是用Go语言编写的,并且可以运行,但是您需要对其进行编译您自己,并且它也不支持等待上一个命令完成.

asciiscript -- it's written in Go and it works, but you need to compile it yourself, and it also doesn't support waiting for the previous command to finish.

spielbash -一个Ruby项目,专门设计用于使用tmux自动执行辅助录音.不过,我没有使用它,因为它不那么可移植,因为您需要现有的Ruby安装,更重要的是,它会不断损坏我所在的活动控制台,并且录音中还会出现无法预料的损坏.此外,自2019年以来,该项目就没有得到承诺.

spielbash -- a Ruby project designed specifically to automate asciinema recordings using tmux. I'm not using this, though, because it's not as portable since you need an existing Ruby installation, and more importantly, it keeps corrupting the active console I'm in, and there's also unpredictable corruption in the recordings. Also, the project hasn't been committed to since 2019.

termscript -它对我不起作用,并且冻结了我的控制台.它在python 2上运行.

termscript -- it just doesn't work for me, and it freezes my console. It runs on python 2.

更新:我最近遇到了终结器.它似乎为实际终端周围的窗口状边框提供了支持,并且它具有内置的GIF渲染器,但我没有尝试过.

UPDATE: I have recently come across terminalizer. It seems to provide support for an window-like border around the actual terminal, and it has a built-in GIF renderer, but I have not tried it.

这篇关于如何使用脚本编写自动化来记录辅助影像记录?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆