sphinxcontrib-programoutput
sphinxcontrib-programoutput copied to clipboard
Add Rich-based SVG Rendering for program-output
This PR introduces the ability to render program output using Rich in an SVG format. When Rich mode is active, the output is styled with colors and formatting, resulting in a nicer visual appearance compared to a standard literal block.
How It Works
- Global Enable: Set
programoutput_force_rich = Truein yourconf.pyto force Rich for all directives. - Per Directive: Use the
:rich:option on a.. program-output::directive. - Width and Colors: Rich respects environment variables like
COLUMNS(to set the console width) andFORCE_COLOR(to force ANSI colors).
Example Usage
.. command-output:: python -m rich
:rich:
PS: in addition I upgraded pyproject.toml and removed setup.py