erbsland-ansi-for-sphinx

Embed static ANSI blocks in Sphinx docs using the erbsland-ansi directive.

Updated Feb 17, 2026
One-click install
npx skills add https://github.com/erbsland-dev/skills --skill erbsland-ansi-for-sphinx
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: erbsland-ansi-for-sphinx
Source: https://github.com/erbsland-dev/skills/tree/main/erbsland-ansi-for-sphinx
Command: npx skills add https://github.com/erbsland-dev/skills --skill erbsland-ansi-for-sphinx

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Sphinx documentation often struggles to display terminal ANSI output reliably; this Skill provides a straightforward path to embed ANSI-formatted blocks directly in docs using the erbsland-ansi extension and its .. erbsland-ansi:: directive, ensuring static ANSI remains readable and properly styled.

Core Features & Use Cases

  • Embed preformatted ANSI blocks into Sphinx docs with automatic styling via a default CSS.
  • Normalize dynamic terminal output using erbsland-ansi-convert before embedding, ensuring consistent rendering across builds.
  • Switch between default and themed styling with the :theme: option and CSS customization.

Quick Start

Enable the extension in conf.py and embed a static ANSI block using the .. erbsland-ansi:: directive.

Frequently Asked Questions about erbsland-ansi-for-sphinx

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I embed ANSI terminal output in Sphinx documentation?

To embed ANSI terminal output in Sphinx documentation, enable the erbsland-ansi extension in conf.py and use the .. erbsland-ansi:: directive to insert preformatted ANSI blocks with automatic default CSS styling.

Why does dynamic terminal output render inconsistently in Sphinx HTML builds?

Dynamic terminal output renders inconsistently in Sphinx HTML builds because it contains live escape sequences. Normalizing captures into static ANSI blocks before embedding ensures consistent rendering across builds.

Can I customize the styling of ANSI blocks in Sphinx?

Yes, you can customize the styling of ANSI blocks in Sphinx by switching between default and themed styling using the :theme: option, or by applying custom CSS modifications to the extension's output.

Do I need to preprocess terminal captures before embedding them in Sphinx docs?

Yes, you need to preprocess dynamic terminal captures into static ANSI blocks using a conversion step before embedding them, ensuring the erbsland-ansi directive renders the content reliably.

What is the best way to display static terminal snippets in Sphinx?

The best way to display static terminal snippets in Sphinx is using the erbsland-ansi directive, which enforces YAML frontmatter with name and description in SKILL.md and applies consistent styling to preformatted ANSI blocks.

Does the erbsland-ansi extension work without additional Sphinx dependencies?

Yes, the erbsland-ansi extension works without additional Sphinx dependencies. It operates as a standalone extension and directive, requiring only the standard Sphinx conf.py configuration to enable block embedding.