Highlight is nice command, but i want to use it as hybrid library.
forked https://github.com/RaimundHuebel/nimhighlight
- Nim 92.6%
- Makefile 3.2%
- Roff 2.9%
- Shell 1.3%
| samples | Highlighter further implemented + Bugfixing. | |
| scripts | Highlighter v0.1 fertig gestellt. | |
| src | Test hilite | |
| tests | Highlighter further implemented + Bugfixing. | |
| .gitignore | Highlighter v0.1 fertig gestellt. | |
| highlight.1 | Highlighter further implemented + Bugfixing. | |
| highlight.nimble | Test hilite | |
| Makefile | Highlighter further implemented + Bugfixing. | |
| nim.cfg | First draft of highlighter/colorize implemented. | |
| README.md | Letzer feinschliff vor publishing. | |
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