adding unofficial coloring rules
This commit is contained in:
@@ -19,6 +19,7 @@ function helpexit() {
|
|||||||
# <> tags
|
# <> tags
|
||||||
# [ ] check list (unofficial)
|
# [ ] check list (unofficial)
|
||||||
# [x] check list (unofficial)
|
# [x] check list (unofficial)
|
||||||
|
# $> $! unofficial colors for executable code blocks
|
||||||
# Color codes
|
# Color codes
|
||||||
|
|
||||||
export HB_RULES='"\[[^]]\+\]([^)]\+)" "$U$B" \
|
export HB_RULES='"\[[^]]\+\]([^)]\+)" "$U$B" \
|
||||||
@@ -32,6 +33,7 @@ export HB_RULES='"\[[^]]\+\]([^)]\+)" "$U$B" \
|
|||||||
"<[^>]\+>" "$K" \
|
"<[^>]\+>" "$K" \
|
||||||
"^\s*\[\s]\s.*" "$y" \
|
"^\s*\[\s]\s.*" "$y" \
|
||||||
"^\s*\[x]\s.*" "$Y" \
|
"^\s*\[x]\s.*" "$Y" \
|
||||||
|
"\$[>!].*\$[>!]" "$c" \
|
||||||
"\${R}.*" "$R" \
|
"\${R}.*" "$R" \
|
||||||
"\${G}.*" "$G" \
|
"\${G}.*" "$G" \
|
||||||
"\${B}.*" "$B" \
|
"\${B}.*" "$B" \
|
||||||
@@ -52,5 +54,5 @@ export HB_RULES='"\[[^]]\+\]([^)]\+)" "$U$B" \
|
|||||||
"\${Z}.*" "$Z" \
|
"\${Z}.*" "$Z" \
|
||||||
'
|
'
|
||||||
|
|
||||||
cat "$@" | highbeam -c | sed 's,\${[RGBCMYrgbcmykKwWU]},,g'
|
cat "$@" | highbeam -c | sed 's,\${[RGBCMYrgbcmykKwWUZ]},,g'
|
||||||
|
|
||||||
|
|||||||
@@ -87,6 +87,8 @@ Special syntaxes:
|
|||||||
parser.add_argument("-v","--version",action="version",version=__version__)
|
parser.add_argument("-v","--version",action="version",version=__version__)
|
||||||
parser.add_argument("--no-color","-n",action="store_false",dest="color",default=True,
|
parser.add_argument("--no-color","-n",action="store_false",dest="color",default=True,
|
||||||
help="Disable color.")
|
help="Disable color.")
|
||||||
|
parser.add_argument("-z",action="store_true",dest="zero",default=False,
|
||||||
|
help="Reset coloring at the end of each line.")
|
||||||
parser.add_argument("filename",type=str,
|
parser.add_argument("filename",type=str,
|
||||||
help="File to show")
|
help="File to show")
|
||||||
opts=parser.parse_args()
|
opts=parser.parse_args()
|
||||||
@@ -104,6 +106,8 @@ for row in f:
|
|||||||
else:
|
else:
|
||||||
colored=bc.nocolor_string(row)
|
colored=bc.nocolor_string(row)
|
||||||
sys.stdout.write(colored.encode('utf-8'))
|
sys.stdout.write(colored.encode('utf-8'))
|
||||||
|
if opts.zero:
|
||||||
|
sys.stdout.write(bc.Z)
|
||||||
sys.stdout.write("\n")
|
sys.stdout.write("\n")
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user