Separated Ninja theme with correct handling of scale

Add a flag for user defined colormaps in the context.
Do not overload the colormap if the user changed it.
Inherit the Ninja theme from the cmake one.
Explanations about themes in the README.
This commit is contained in:
Johann Dreo 2014-05-02 19:30:26 +02:00
commit 9fd0df9963
4 changed files with 47 additions and 9 deletions

View file

@ -266,3 +266,22 @@ cmake and g++ themes:
You then can use the `cm` alias as a prefix to your build command,
for example: `cm make test`
### Themes
You can easily add your own theme to colout.
A theme is basically a module with a function named `theme` that take the configuration context as an argument and
return back the (modified) context and a list of triplets.
Each triplet figures the same arguments than those of the command line interface.
def theme(context):
return context,[ [regexp, colors, styles] ]
With the context dictionary at hand, you have access to the internal configuration of colout, you can thus change colormaps for
special keywords, the scale, even the available colors, styles or themes.
See the cmake theme for how to modify an existing colormap if (and only if) the user didn't ask for an
alternative one.
See the ninja theme for how to extend an existing theme with more regexps and a different configuration.
See the gcc theme for an example of how to use the localization of existing softwares to build translated regexp.