[PR #669] [CLOSED] Add option to include custom HTML into <head> when streaming with --serve #1181

Closed
opened 2026-03-15 11:23:05 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/asciinema/asciinema/pull/669
Author: @lubosmato
Created: 2/1/2025
Status: Closed

Base: developHead: develop


📝 Commits (1)

  • 7882f56 feat(stream): add option to include custom HTML into <head> for stream --serve

📊 Changes

5 files changed (+39 additions, -4 deletions)

View changed files

📝 assets/index.html (+3 -0)
📝 src/cli.rs (+5 -0)
📝 src/cmd/stream.rs (+1 -0)
📝 src/streamer/mod.rs (+4 -0)
📝 src/streamer/server.rs (+26 -4)

📄 Description

This adds a CLI arg into asciinema stream:

  -H, --html-head [< <style> * { font-family: monospace; } </style> >]
          Additional content to include in the HTML head in case of streaming with built-in HTTP server

Use-case is to allow quickly add customizations. For example adding custom fonts (e.g. Nerd Fonts):

asciinema stream -s 0.0.0.0:8080 -H '<style>
  @import url(https://cdn.jsdelivr.net/gh/mshaugh/nerdfont-webfonts@v3.3.0/build/firacode-nerd-font.css);
  * {
    font-family: "FiraCode Nerd Font", monospace;
  }
  </style>'

Results in:

https://asciinema.org/a/2vUX3OJVwCjpNEgArf0IhQnj8

image

Resolve #670


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/asciinema/asciinema/pull/669 **Author:** [@lubosmato](https://github.com/lubosmato) **Created:** 2/1/2025 **Status:** ❌ Closed **Base:** `develop` ← **Head:** `develop` --- ### 📝 Commits (1) - [`7882f56`](https://github.com/asciinema/asciinema/commit/7882f56af707563ee029cd852c73e05abc0d4a4d) feat(stream): add option to include custom HTML into <head> for stream --serve ### 📊 Changes **5 files changed** (+39 additions, -4 deletions) <details> <summary>View changed files</summary> 📝 `assets/index.html` (+3 -0) 📝 `src/cli.rs` (+5 -0) 📝 `src/cmd/stream.rs` (+1 -0) 📝 `src/streamer/mod.rs` (+4 -0) 📝 `src/streamer/server.rs` (+26 -4) </details> ### 📄 Description This adds a CLI arg into `asciinema stream`: ``` -H, --html-head [< <style> * { font-family: monospace; } </style> >] Additional content to include in the HTML head in case of streaming with built-in HTTP server ``` Use-case is to allow quickly add customizations. For example adding custom fonts (e.g. Nerd Fonts): ``` asciinema stream -s 0.0.0.0:8080 -H '<style> @import url(https://cdn.jsdelivr.net/gh/mshaugh/nerdfont-webfonts@v3.3.0/build/firacode-nerd-font.css); * { font-family: "FiraCode Nerd Font", monospace; } </style>' ``` Results in: https://asciinema.org/a/2vUX3OJVwCjpNEgArf0IhQnj8 ![image](https://github.com/user-attachments/assets/47f992e6-645a-4180-9755-03df0844e533) Resolve #670 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-15 11:23:05 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/asciinema#1181
No description provided.