Skip to content

Add customizable Themes and Highlighters for rich colors in print_msg#5169

Open
Crivella wants to merge 7 commits into
easybuilders:developfrom
Crivella:feature-rich_themes
Open

Add customizable Themes and Highlighters for rich colors in print_msg#5169
Crivella wants to merge 7 commits into
easybuilders:developfrom
Crivella:feature-rich_themes

Conversation

@Crivella

@Crivella Crivella commented Apr 9, 2026

Copy link
Copy Markdown
Contributor

This is a followup on

With this PR, Easybuild ships its own highlighter and theme that can be replaced using entrypoints (for now only the theme) using the following groups

  • easybuild.rich_theme: A dictionary that defines the rich theme to be used

TODO:

  • Expand what EB should highlight by default
  • Define a good color scheme to avoid too much clutter
  • Add to the entrypoint documentation
  • Tests

Example of themes via entrypoints:

@Crivella

Crivella commented Apr 9, 2026

Copy link
Copy Markdown
Contributor Author

@boegel @smoors Let me know design-wise what you think about this, if it is worth investing more time in trying to expand this more (eg also make the highlighter pluginable).

In general going to need feedback on colors and patterns, my UI design skills are not the best so i am afraid of going full rainbow with the colors

@smoors

smoors commented Apr 18, 2026

Copy link
Copy Markdown
Contributor

looks good to me design-wise!
i quickly tested it and it works well, also with the entrypoints.

it would be nice if you can also add support for customizing the things that are colored automatically, like paths, numbers, ... (i'm not a fan of the default colors)

i can come up with a default color scheme, but i don't want to get into a bike-shedding match :)

@Crivella

Copy link
Copy Markdown
Contributor Author

It is already possible by overriding the defaults styles the same way you would by setting easybuild.success and similar

You can see all the defaults with python -m rich.default_styles

@smoors

smoors commented Apr 19, 2026

Copy link
Copy Markdown
Contributor

It is already possible by overriding the defaults styles the same way you would by setting easybuild.success and similar

You can see all the defaults with python -m rich.default_styles

cool, thx!

@smoors

smoors commented Apr 26, 2026

Copy link
Copy Markdown
Contributor

@Crivella i played a bit with the default theme, and settled on this PR:
Crivella#3

see light and dark screenshots below for the result.
feel free to modify as you please.

Screenshot From 2026-04-25 19-46-04 Screenshot From 2026-04-25 19-45-36

Comment thread easybuild/tools/output.py Outdated
@Crivella

Copy link
Copy Markdown
Contributor Author

@smoors

I''ve overhauled a bit the way the Entrypoints are defined to homogenize the way they are exposed with the already existing ones.
In this case since you cannot decorate a dictionary we have to have them as functions that return the dictionary.

This allows to also easily show them as available EPs when running --show-config

I've' also added the option to customize the highlighters, just unsure if the build_option and CLI param should be output[_/-]highlights or output[_/-]highlighters

@Crivella

Copy link
Copy Markdown
Contributor Author

Another idea which might be overkill is to allow a NONE value to disable our custom highlighting but leave the rich one on

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants