color: document that labels are used for colorizing text
authorJordi Gutiérrez Hermoso <jordigh@octave.org>
Sun, 24 Aug 2014 17:35:36 -0400
changeset 22462 fbd67cf34799
parent 22461 864bc2f4279b
child 22463 1c4ae0f6a30f
color: document that labels are used for colorizing text It is a deeply hidden secret that it's possible to colorise so many things with so many different labels. This is an attempt to document this. The text is a bit long, but it seems as short as can be while documenting everything. Perhaps it should be hidden under a --verbose option.
hgext/color.py
--- a/hgext/color.py	Wed Aug 27 16:39:44 2014 +0200
+++ b/hgext/color.py	Sun Aug 24 17:35:36 2014 -0400
@@ -19,7 +19,16 @@
 available, then effects are rendered with the ECMA-48 SGR control
 function (aka ANSI escape codes).
 
-Default effects may be overridden from your configuration file::
+Text receives color effects depending on the labels that it has. Many
+default Mercurial commands emit labelled text. You can also define
+your own labels in templates using the label function, see :hg:`help
+templates`. A single portion of text may have more than one label. In
+that case, effects given to the last label will override any other
+effects. This includes the special "none" effect, which nullifies
+other effects.
+
+The following are the default effects for some default labels. Default
+effects may be overridden from your configuration file::
 
   [color]
   status.modified = blue bold underline red_background