Permalink
Browse files

Proof of concept

  • Loading branch information...
0 parents commit a47f9844069692dff8e2d2b482b0ef06928b9455 @mvuets committed Mar 27, 2012
Showing with 43 additions and 0 deletions.
  1. +43 −0 sdcv-color
@@ -0,0 +1,43 @@
+#!/usr/bin/env perl
+
+use strict;
+use warnings;
+use utf8;
+use open qw(:utf8 :std);
+
+use Term::ANSIColor;
+
+
+=for comment
+clear/reset bold dark/faint underline/underscore blink reverse concealed
+
+black red green yellow blue magenta cyan white
+bright_*
+on_*
+on_bright_*
+
+=cut
+
+my %theme = (
+ dict_name => 'bold underline bright_yellow',
+ transcription => 'green',
+);
+
+
+open my $pager, '|-', 'less';
+select $pager;
+
+while (<>) {
+ chomp;
+
+ if (/^-->(.+)/) {
+ $_ = colored($1, $theme{dict_name});
+ }
+ elsif (/^(\[.+\])/) {
+ $_ = colored($1, $theme{transcription});
+ }
+
+ s/&apos;//g;
+
+ print $_, "\n";
+}

0 comments on commit a47f984

Please sign in to comment.