Setup


Configuration

Global Usage

In your mkdocs.yml file, in the plugins section, you can configure the Asciinema Player plugin globally. Any option you set here will apply to all Asciinema Player blocks, unless overridden in an individual block:

plugins:
  - search
  - asciinema-player:
      loglevel: "INFO"
      title: "Terminal"
      mkap_theme: "night"
      cols: 80
      rows: 24
      auto_play: false
      preload: false
      loop: false
      start_at: "0:00"
      speed: 1.0
      theme: "asciinema"
      fit: "width"
      controls: "auto"
      pause_on_markers: false
      terminal_font_size: "small"
      terminal_font_family: "Consolas"
      terminal_line_height: "1.33333333"

Individual Usage

To use individual configurations, create a JSON object like the example below:

{
    "file": "assets/asciinema/bootstrap.cast",
    "cols": 80,
    "auto_play": "true"
}

Important: "file" is required for every individual block.

Available Configuration Options

Parameter Default Scope Description
loglevel "INFO" Global only Log level of the plugin ("DEBUG", "INFO", "WARNING", "ERROR", "FATAL").
title "Terminal" Global + Individual Title of the terminal.
mkap_theme "night" Global + Individual Theme of the terminal.
cols 80 Global + Individual Number of columns in the terminal.
rows 24 Global + Individual Number of rows in the terminal.
auto_play false Global + Individual Automatic playback upon load.
preload false Global + Individual Preload the cast file on load.
loop false Global + Individual Enable looped playback.
start_at "0:00" Global + Individual Start playback at a specific time.
speed 1.0 Global + Individual Playback speed multiplier.
theme "asciinema" Global + Individual Terminal theme for rendering.
fit "width" Global + Individual Terminal fit mode.
controls "auto" Global + Individual Display controls automatically.
pause_on_markers false Global + Individual Pause playback on markers.
terminal_font_size "small" Global + Individual Font size of the terminal.
terminal_font_family "Consolas" Global + Individual Font family of the terminal.
terminal_line_height "1.33333333" Global + Individual Line height of the terminal.

For more detailed information and additional options, refer to the official documentation.