1
0
Fork
You've already forked hilite
0
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%
Find a file
2025年05月05日 21:57:34 +02:00
samples Highlighter further implemented + Bugfixing. 2020年09月16日 17:56:47 +02:00
scripts Highlighter v0.1 fertig gestellt. 2020年09月09日 17:34:54 +02:00
src Test hilite 2025年05月05日 21:57:34 +02:00
tests Highlighter further implemented + Bugfixing. 2020年09月16日 17:56:47 +02:00
.gitignore Highlighter v0.1 fertig gestellt. 2020年09月09日 17:34:54 +02:00
highlight.1 Highlighter further implemented + Bugfixing. 2020年09月16日 17:56:47 +02:00
highlight.nimble Test hilite 2025年05月05日 21:57:34 +02:00
Makefile Highlighter further implemented + Bugfixing. 2020年09月16日 17:56:47 +02:00
nim.cfg First draft of highlighter/colorize implemented. 2020年09月01日 14:15:54 +02:00
README.md Letzer feinschliff vor publishing. 2020年10月12日 17:57:20 +02:00

Nim Highligter

nimble

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