diff --git a/apt_update_palette_firecode.png b/apt_update_palette_firecode.png new file mode 100644 index 0000000..5818b6b Binary files /dev/null and b/apt_update_palette_firecode.png differ diff --git a/cmake_scale.png b/cmake_scale.png index e04c562..cebcd5e 100644 Binary files a/cmake_scale.png and b/cmake_scale.png differ diff --git a/index.html b/index.html index afa3c92..d23b0cc 100644 --- a/index.html +++ b/index.html @@ -38,7 +38,8 @@ Hosted on GitHub Pages — Theme by mattgraham -

colout

+ +

colout

Introduction

@@ -53,6 +54,7 @@ Patterns are regular expressions.

You can think of colout as an alternative to grep --color which will preserve the surrounding context, whith more powerful coloring capabilites.

+

Useful examples

Basic coloring

@@ -77,6 +79,7 @@ particularly useful when examining logs.

+

Multiple colors

Using groups in the regular expressions, you can highlight several matchs in different colors.

@@ -87,13 +90,28 @@ but r-x for others:

-

Using colormaps, you can change the colors for each lines, this is particularly useful for reading logs that have long -lines that are wrapped. + +

Color maps

+ +

Using colormaps, you can change the colors for each lines

+ +

Predefined colormaps are particularly useful for reading logs that have long +lines that are wrapped.

tail /var/log/kern.log | colout "^.*$" rainbow

-

If you want more colors, you can highlight each line of your log with a random one among the 256 ANSI colors:

+

But you can also create your own colormap, using the -c switch, for example to alternate two colors:

+

tail /var/log/kern.log | colout -c "^.*$" blue,yellow normal

+ +

+ +

If you prefer a rainbow with more colors, just use an upper-case R. For example to color a progress bar:

+

echo "Progress [########################] 100%" | colout "#" Rainbow

+ +

+ +

If you want even more colors, you can highlight each line of your log with a random one among the 256 ANSI colors:

tail /var/log/dmesg | colout "^.*$" Random

@@ -108,6 +126,17 @@ lines that are wrapped.

+ +

Palettes

+ +

You can load extern palettes as colormaps. colout supports the GIMP Palette format (*.gpl, used by GIMP and inkscape, +for instance) and will translate them from their RGB values to their nearest ANSI colors (which may thus contains +fewer colors than the orginal RGB palette).

+ +

sudo apt-get update | colout -P /usr/share/gimp/2.0/palettes/ "^.*$" Firecode

+

+ +

Source code

You can use colout as a basic proxy to the pygments library, if you want to highlight a source code.

@@ -125,6 +154,7 @@ for spotting code in a log.

+

Themes

colout comes with a set of handy shortcuts for coloring common outputs.

@@ -140,11 +170,12 @@ following shortcut:

+

Tips

To be able to use the syntax highlighting, you should install the python-pygments library.

-

colout -h will give you the lists of available colors, themes and programming languages.

+

colout -r will give you the lists of available colors, colormaps, themes and supported programming languages.

Colormaps and source code syntax highlighting most often comes in 8 or 256 colors mode. Use a lower case first letter for the 8 colors mode and an upper case first one for the 256 colors.

@@ -153,15 +184,17 @@ for the 8 colors mode and an upper case first one for the 256 colors.

should use 256 colors mode, and thus upper case the first letter of the language name, or else the style is ignored.

You can leave simple words without quotes, but it is better to put the regexp in quotes to avoid escaping special -characters that would overwise be interpreted -by your shell (like parenthesis).

+characters that would overwise be interpreted by your shell (like parenthesis).

Do not hesitate to design your own theme, they are defined as separated files, and basically are just like chaining several calls to colout in pipes, with the possibility to use python code around.

+ +

Don't use nested groups or colout will duplicate the corresponding input text with each matching colors.

+ - + diff --git a/kern_log_yb.png b/kern_log_yb.png new file mode 100644 index 0000000..64128fa Binary files /dev/null and b/kern_log_yb.png differ diff --git a/progress_Rainbow.png b/progress_Rainbow.png new file mode 100644 index 0000000..5626044 Binary files /dev/null and b/progress_Rainbow.png differ