Releases: erbsland-dev/erbsland-sphinx-ansi
Release 1.2.4 - Restoring Integration Compatibility
This patch release restores compatibility with integrations that construct ANSI literal blocks using the classic docutils literal_block(rawsource, text) calling style.
Fixed
- Restored the positional
textargument forANSILiteralBlock. - Fixed compatibility with
sphinxcontrib-programoutputwhenprogramoutput_use_ansi = True, where output nodes are created asANSILiteralBlock(output, output). - Added regression tests for the two-argument construction through both HTML and non-HTML parser paths.
Documentation
- Improved the README and main documentation with clearer feature descriptions.
- Clarified that
erbsland-sphinx-ansirenders ANSI text styling but is not a terminal emulator. - Added guidance for preprocessing terminal output with
erbsland-ansi-convertwhen output depends on cursor movement, screen clearing, or other terminal control behavior.
Maintenance
- Added missing utility library files that were previously excluded by
.gitignore.
Update dependencies and project configuration
This release focuses on maintenance updates and project configuration improvements. No functional changes have been made to the extension itself.
- Updated the documented and configured Python version requirement to 3.13 in both the documentation and pyproject.toml.
- Refreshed requirements-dev.txt and updated the associated dependency hashes.
- Adjusted Hatch configuration for improved Python 3.13 compatibility.
Improve compatibility, build tooling, and project maintenance
This release focuses on improving compatibility with JavaScript-based syntax highlighters, strengthening the build infrastructure, and streamlining development workflows.
- Wrapped the
<pre>output in an additional<div>container to improve compatibility with JavaScript-based Pygments formatters. - Added the
nohighlightCSS class to both the<pre>and<div>elements for the same compatibility reasons. - Refactored the internal AST type into a dedicated container structure.
- Hardened the build process and improved the GitHub workflow configuration.
- Introduced additional build utilities, including a
pre_commitaction. - Updated all project dependencies to their latest compatible versions.
Fix built-in stylesheet background color handling
Corrected an issue where extended background colors were not applied properly in the built-in stylesheet.
Maintenance Release with Updated Hatch Configuration
This is a maintenance release focused on packaging, testing, and development workflow improvements. There are no functional changes to the Sphinx ANSI extension itself compared with v1.1.2.
What's changed
- Added
docutilsto the test and build environments to make CI and package builds more reliable. - Updated the Hatch configuration to support
hatch testanduv run pytest(#1 by henryiii). - Refreshed development dependency versions in
requirements-dev.txt. - Clarified development requirements in the README.
- Added
uv.lockto.gitignore.
Add Handling for CSI Sequences and Partial Resets
This release improves how ANSI control sequences are processed, making it easier for you to work with terminal output directly.
Improvements
- Unknown CSI (Control Sequence Introducer) sequences are now safely ignored and removed from the output.
- This allows you to use more terminal output directly in the extension without requiring pre-filtering.
- Support for partial color reset sequences has been added and is now handled correctly.
Important Notes
The extension intentionally does not implement full terminal emulation in order to maintain high performance.
If your output includes complex terminal behavior (for example, cursor movements or dynamic updates), you should preprocess it before use.
We recommend using erbsland-py-ansi-convert for this purpose.
This ensures that the output is normalized and compatible with the extension.
Summary
With these changes, you can rely on cleaner and more predictable handling of ANSI sequences, while still keeping full control over performance and preprocessing when needed.
Expand Python compatibility and add theme support
- Lower minimum Python requirement from 3.12+ to 3.10+
- Add theme support via the
themeparameter - Remove IDE-specific files from the repository
Update Hatch build config to adjust the package path
A misconfigured package path in the Hatch build configuration prevented the package from being installed correctly in certain environments.
This release fixes the build configuration so the package is now installed properly via pip and other standard tooling.
If you experienced installation issues with previous versions, please upgrade to this release.
Initial Public Release
We are happy to announce the first public release of erbsland-sphinx-ansi — a lightweight Sphinx extension for rendering ANSI-colored terminal output directly in your documentation.
If you document command-line tools, build logs, CI output, or interactive sessions, this extension allows you to keep realistic, colorized terminal examples in your HTML documentation without screenshots or manual styling.
Features
- Render ANSI color and formatting codes inside Sphinx documentation
- Clean integration via a dedicated
.. erbsland-ansi::directive - Optional
:escape-char:parameter for readable source files - Lightweight and easy to integrate
- No additional configuration required beyond enabling the extension
If you encounter issues or have feature suggestions, feel free to open an issue or discussion on GitHub.