yuikns
V2EX  ›  反馈

可否在发帖和回复内容中支持一下 asciinema?

  •  
  •   yuikns · Mar 16, 2019 · 3565 views
    This topic created in 2636 days ago, the information mentioned may be changed or developed.

    @Livid

    asciinema 是一个非常好的终端录制工具。

    我们安装好 asciinema,一个基于 python 的小工具后,执行

    asciinema rec -i 1.0 -t my-name
    

    然后执行我们的命令,然后我们就能录制一些输入了。因为是保存为基于 cli 的 json 内容,因此数据包相对较小。

    发布和嵌入网站的脚本也很容易。参考此处官方文档 https://asciinema.org/docs/embedding

    我们只要识别出 url,然后嵌入内容如下:

    <script src="https://asciinema.org/a/14.js" id="asciicast-14" async></script>
    

    网页中就会产生一个嵌入的小播放器,按照程序中的参数播放。

    相比 gif,在特定场合下它要方便得多。

    如果担心 embed the player 有风险,那么类型下面这样 svg 的图片链接,用户跳转到它们主站播放也能很好的发动图了。

    <a href="https://asciinema.org/a/14" target="_blank"><img src="https://asciinema.org/a/14.svg" /></a>
    

    如果可以实现,那太感谢了

    No Comments Yet
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   3373 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 33ms · UTC 11:18 · PVG 19:18 · LAX 04:18 · JFK 07:18
    ♥ Do have faith in what you're doing.