yarsync icon indicating copy to clipboard operation
yarsync copied to clipboard

Add rich text formatting (colours, boldness) to the output via click

Open ynikitenko opened this issue 3 years ago • 2 comments

UPD: click looks good for that.

Requirements for a formatting tool:

  • cross-platform (and disabled when it is not installed / supported)
  • high-level (and take care to restore original colours after the exit).

Probably some other factors should also be taken into consideration. Note, that we don't need full True Colours, but rather simply enhance user experience in several small places.

These packages look good: yachalk and colorful (the latter looks more powerful, because it supports Windows and Python 2 (if we ever use that)). There is also some comparison on StackOverflow.

Formatting could be based on how git formats its output. Volunteers are welcome! If you take on this task, let us agree on the package first.

ynikitenko avatar Jun 16 '22 08:06 ynikitenko

Colorama seems to be very developed and used. Rich allows powerful text formatting (centering, etc.), seems most used, is cross-platform, but doesn't support Python 2. It is also heavy-weight (1 Mb in my installation, don't know when I installed that) and requires commonmark and pygments. It looks very well. Maybe use that after this program becomes rich itself. Click looks perfect: not only it allows simple colours, but also text scrolling (should be used in logs) launching editors (for commit) and autocomplete.

ynikitenko avatar Jun 16 '22 08:06 ynikitenko

Is it a good idea to start with colorization like >f+++++++++, .d..t...... of yarsync status or similar command?

Users may be more concerned about files that modify or delete.

Maybe deletions are red, modifications are yellow, new additions are green, etc.

In addition to color, a filter to show only deleted or modified files might be useful.

r888800009 avatar Nov 12 '23 00:11 r888800009