mirror of
https://github.com/RaimundHuebel/nimhighlight
synced 2026-01-14 02:51:46 +00:00
No description
| samples | ||
| scripts | ||
| src | ||
| tests | ||
| .gitignore | ||
| highlight.1 | ||
| highlight.nimble | ||
| Makefile | ||
| nim.cfg | ||
| README.md | ||
Nim Highligter
Introduction
Provides a tool and a library to colorize the output of cli-tools. This project is inspired by the ruby-gem colorize (https://github.com/fazibear/colorize).
Get Started
Install Nim Highlighter
$ nimble install nimhighlight
Using cli-tool hightlight:
# Show help ...
$ highlight --help
# Colorize Std-Input ...
$ echo "hello dude world" | highlight -e=".+:blue" -e=ello:green -e="l:red" -e=worl:magenta:yellow
# Example: Highlight keywords in source-file ...
$ cat src/highlight.nim | dist/release/highlight -e="^.+:black" -e="while|true|false|when|type|case:yellow" -e="#.+:green" -n
# Create and use config file ...
$ highlight --init -e=".+:blue" -e=ello:green -e="l:red" -e=worl:magenta:yellow
$ echo "hello dude world" | highlight
Using Nim Highlighter as library
import highlightpkg/colorize
echo "Hello World".green
echo "Hello World".onYellow
echo "Hello World".yellow.onBlue
Develop
Running Tests
$ nimble test
