Skip to content
This repository was archived by the owner on Sep 10, 2026. It is now read-only.

v3.1.0: Prettify everything!

Choose a tag to compare

@bczsalba bczsalba released this 27 Feb 11:31
· 661 commits to master since this release

This is a relatively minor release, mostly focused on the new pretty-printing functionality. I wanted to release this before the next major update, as that may take some time and these features are really useful in their own right.

The new MarkupLanguage.prettify method is quite customizable: It allows you to customize all of the builtin styles it uses, as well as set indentation count, force ANSI sequences to be displayed as markup or force data-structures to be displayed flat (condensed). The default style looks really good in my opinion, and it should be a very useful tool.

Obviously, the idea was inspired by Rich's implementation of the same concept, but I tried to fix all my grievances with that version.

Additions

  • Add Terminal.pixel_size attribute (6e350b1, ce27e3c)
  • Add prettify_ansi, pprintandsetup_displayhook()methods toMarkupLanguage`` (5bdf617)

Bugfixes

  • Fix starting state not being reverted after animation finish (#38, 135a5bf)

Showcase

Here is a quick demo of some of the prettifying functionality.

Screenshot 2022-02-27 at 12 14 28