Skip to content

Asciinema player

asciinema-player allow to display a text based file format video of a Linux terminal. It is very lightweight and easy to use.

Example: https://mee-labs.gitlab-pages.imt-atlantique.fr/vhdl/vhdl-mistakes/

The video is recorded as a text file. For specific needs, it can be manually edited.

Installation

On local computer to record a video

On a linux machine via apt:

1
sudo apt install asciinema

Via python pip (eventually in a virtual environment):

1
pip3 install asciinema

On mkdocs

In the requirements.txt file of the repository, add the line:

1
mkdocs-asciinema-player

Configuration

in the mkdocs.yml:

1
2
plugins:
  - asciinema-player

Record a video

On a local linux:

1
asciinema rec my-video.cast

To play it locally:

1
asciinema play my-video.cast

Integrate a video in mkdocs pages

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
```asciinema-player #
{
    "file": "cast/my-video.cast",
    "mkap_theme": "penguin",
    "auto_play": false,
    "cols": 100,
    "rows": 36,
    "control": "auto",
    "idleTimeLimit": 1,
    "speed": 1.5
}

```

Warning

Due to rendering issue on this page, a # has been introduced after asciinema-player in the previous code block

It should be removed in an actual use.

Option Description
file Path to the cast file.
mkap_theme Theme of the terminal.
auto_play Automatic playback upon load.
cols Number of columns in the terminal.
rows Number of rows in the terminal.
control Display controls automatically.
idleTimeLimit Limit terminal inactivity to a given number of seconds.
speed Playback speed multiplier

Source