Skip to content

docs: color CLI on Python 3.14+#1218

Merged
henryiii merged 3 commits intomainfrom
henryiii/docs/colorcli
Feb 19, 2026
Merged

docs: color CLI on Python 3.14+#1218
henryiii merged 3 commits intomainfrom
henryiii/docs/colorcli

Conversation

@henryiii
Copy link
Collaborator

Adding color to the CLI docs.

Signed-off-by: Henry Schreiner <henryfs@princeton.edu>
@LecrisUT
Copy link
Collaborator

Why the change in dependency? Is upstream not maintained, or lacking some feature, or ... ?

Copy link
Collaborator

@LecrisUT LecrisUT left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Main concern with this for me is having to carry the color definitions, formatting, etc. Would prefer for this to be the responsibility of furo, where they seem to have quite good designers, i.e. it could provide some css styles and this or sphinxcontrib-programoutput would simply format it to a pre-defined styles, like in the sphinx-contrib/ansi. My css knowledge is close to none, but I believe that that is also how they shift the colors in light and dark mode

@henryiii
Copy link
Collaborator Author

henryiii commented Feb 17, 2026

I'd be happy to use an extension for this if there's a working one. There are also a few other options. I have implemented this with rich, but for mkdocs, in pypa/cibuildwheel#2407. I developed this for Sphinx in pypa/packaging#795 (in a comment, didn't add to the PR); there I was more aware of adding dependencies, so I did it without rich, but we could use rich here (and maybe there). That would probably look pretty good.

This does support light/dark mode.

As for plugins, https://github.com/OpenNTI/sphinxcontrib-programoutput hasn't had a release in over a year, and OpenNTI/sphinxcontrib-programoutput#49 was closed about 5 years ago. I did comment on that about a year ago with no response (though it is a closed issue). This seems to be since sphinxcontrib-ansi was last released 15 years ago and last touched 6 years ago. There is a nice suggestion on a new version in sphinx-contrib/ansi#12, but also untouched.

Copy link
Collaborator

@LecrisUT LecrisUT left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well the dependency state is just bad around these. Guess this is better then nothing, if anything goes wrong maybe sphinx -W will catch it (we are running those right?)

@henryiii henryiii force-pushed the henryiii/docs/colorcli branch 3 times, most recently from b4cb1bb to d97b794 Compare February 18, 2026 21:15
Signed-off-by: Henry Schreiner <henryfs@princeton.edu>
@henryiii henryiii force-pushed the henryiii/docs/colorcli branch from d97b794 to ed12c2e Compare February 19, 2026 04:00
Signed-off-by: Henry Schreiner <henryfs@princeton.edu>
@henryiii
Copy link
Collaborator Author

I think the styling looks good in both modes (https://scikit-build-core--1218.org.readthedocs.build/en/1218/reference/cli.html) - let's go with this.

@henryiii henryiii merged commit 8ae8bce into main Feb 19, 2026
65 of 69 checks passed
@henryiii henryiii deleted the henryiii/docs/colorcli branch February 19, 2026 06:09
@LecrisUT
Copy link
Collaborator

Looks very promissing. Maybe let sphinxcontrib-programoutput about this, and maybe also furo if they have suggestions for the css?

@henryiii
Copy link
Collaborator Author

I've opened OpenNTI/sphinxcontrib-programoutput#73 (and several PRs), we'll see if it moves forward.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

Comments