termtosvg

将终端会话记录为 SVG 动画。「Record terminal sessions as SVG animations」

Github stars Tracking Chart

注意:自2020年6月起,我不再有时间维护termtosvg,并且此存储库现在为只读。

termtosvg

termtosvg 是用 Python 编写的 Unix 终端记录器,可将命令行会话呈现为独立的 SVG 动画。

特性

制作轻巧,外观清晰的动画或可嵌入项目页面的静止帧
通过用户定义的SVG模板自定义颜色主题,终端UI和动画控件
呈现以asciinema格式制作的asciicast格式的录音

安装

termtosvg 与 Linux、macOS 和 BSD 操作系统兼容,要求 Python>= 3.5,并且可以使用 pip 如下安装:

#创建名为 '.venv' 的 virtualenv
python3 -m venv .venv
#激活 virtualenv
source .venv/bin/activate
pip3 install termtosvg

然后通过调用 termtosvg 或 python3 -m termtosvg 运行 termtosvg。

社区提供了各种独立维护的,特定于操作系统的软件包:

OS Repository Installation command
Archlinux Arch pacman -S termtosvg
FreeBSD ports
Gentoo media-gfx/termtosvg emerge media-gfx/termtosvg
macOS Homebrew brew install termtosvg
OpenBSD ports
NixOS nixpkgs

基本用法

开始录制:

$ termtosvg
Recording started, enter "exit" command or Control-D to end

现在,您位于 subshell 中,可以像往常一样键入命令。 完成后,退出外壳程序以结束记录:

$ exit
Recording ended, file is /tmp/termtosvg_exp5nsr4.svg

然后,使用您喜欢的 Web 浏览器播放动画:

$ firefox /tmp/termtosvg_exp5nsr4.svg

最后,将动画嵌入到诸如 GitHub 上的 README.md 文件,可以通过动画的相对链接来实现:

![Example](./docs/examples/awesome_window_frame.svg)

有关更多详细信息,请参见手册页

依存关系

termtosvg 使用:

  • pyte 渲染终端屏幕
  • lxml 使用 SVG 数据

Main metrics

Overview
Name With Ownernbedos/termtosvg
Primary LanguagePython
Program languageMakefile (Language Count: 2)
PlatformBSD, Linux, Mac
License:BSD 3-Clause "New" or "Revised" License
所有者活动
Created At2018-06-09 13:52:09
Pushed At2020-06-16 11:01:41
Last Commit At2020-01-18 21:02:59
Release Count20
Last Release Name1.1.0 (Posted on )
First Release Name0.1.0 (Posted on 2018-06-16 19:05:08)
用户参与
Stargazers Count9.7k
Watchers Count131
Fork Count436
Commits Count190
Has Issues Enabled
Issues Count86
Issue Open Count11
Pull Requests Count19
Pull Requests Open Count1
Pull Requests Close Count15
项目设置
Has Wiki Enabled
Is Archived
Is Fork
Is Locked
Is Mirror
Is Private

Build Status

termtosvg

termtosvg is a Unix terminal recorder written in Python that renders your command
line sessions as standalone SVG animations.

Example

Features

  • Produce lightweight and clean looking animations or still frames embeddable on a project page
  • Custom color themes, terminal UI and animation controls via user-defined SVG templates
  • Rendering of recordings in asciicast format made with asciinema

Installation

termtosvg is compatible with Linux, macOS and BSD OSes, requires Python >= 3.5 and can be installed as follows using pip:

# Create virtualenv named '.venv'
python3 -m venv .venv
# Activate virtualenv
source .venv/bin/activate
pip3 install termtosvg

Then run termtosvg by calling either termtosvg or python3 -m termtosvg.

Various independently maintained, OS specific packages have been made available by the community: