Skip to content

Commit

Permalink
Added -bytes parameter to limit maximum row width in bytes
Browse files Browse the repository at this point in the history
Also added:
- skip backspace characters
- fixed underline/bold confusion w/ PuTTY
- better error reporting for ansi.Merge(...)
- handle ESC[m reset in ansi.VF_SGR() validator
  • Loading branch information
BourgeoisBear committed Aug 12, 2017
1 parent c529b4a commit b01a27d
Show file tree
Hide file tree
Showing 5 changed files with 696 additions and 700 deletions.
11 changes: 3 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,10 @@
# = EXPAND ON USE
APPNAME := ansiart2utf8

# TODO: INCLUDE TEST IMAGES IN GITHUB
# TODO: NEW DEMO IMAGE IN MARKDOWN FILE

# FOR LIVE TESTING (REQUIRES ag (siver-searcher) AND entr)
# ag -l --go | entr -s 'make buildtest'

# find -type f -name 'l*.ans' -exec ../../ansiart2utf8 -d -f {} \;

# ls TEST.ans | entr -c -s 'cat ./TEST.ans'
# find -type f -name '*.ans' -exec ../../ansiart2utf8 -d -f {} \;

default: build

Expand All @@ -19,11 +14,11 @@ buildtest:
reset ; go build -v -o $(APPNAME) ; if [ $$? -eq 0 ] ; then make test ; fi

test:
./ansiart2utf8 -f ./test_data/ZOMBIE_KILLING.ans > ./processed.ans
./ansiart2utf8 -d -f ./test_data/ZOMBIE_KILLING.ans
./ansiart2utf8 -d -f ./test_data/_07_Calendar_2017_July_by_Andy_Herbert.ans
./ansiart2utf8 -d -f ./test_data/fruit.ans
# ./ansiart2utf8 -d -w 200 -f ./bt-will_be_blocks/WZ\ -\ DJAC.ans
# ./ansiart2utf8 -d -w 200 -f ./bt-will_be_blocks/WZ\ -\ DJAC.ans
# ./ansiart2utf8 -d -w 220 -f ./bt-will_be_blocks/WZ\ -\ Gord\ Downie.ans | tee ./processed.ans

debug:
ag -l --go | entr -s 'make run'
Expand Down
14 changes: 8 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,16 @@ Escape codes and line endings are processed for terminal friendliness.
USAGE: ansiart2utf8 [OPTION]...
OPTIONS
-d DEBUG MODE: LINE NUMBERING + PIPE @ \n
-bytes uint
MAXIMUM OUTPUT BYTES PER-ROW (0 = NO LIMIT)
-d DEBUG MODE: LINE NUMBERING + PIPE @ \n
-f string
INPUT FILENAME, OR "-" FOR STDIN (default "-")
-w uint
LINE WIDTH (default 80)
```

BEFORE & AFTER
Before & After
--------------
**BEFORE**
![Before ansiart2utf8 processing][imgBefore]
Expand All @@ -25,7 +27,7 @@ BEFORE & AFTER
[imgBefore]: ansiart2utf8-before.gif "ANSI in Terminal Before Processing"
[imgAfter]: ansiart2utf8-after.gif "ANSI in Terminal After Processing"

NOTES
Notes
-----
To build:

Expand All @@ -41,11 +43,11 @@ To build:
- [Envy Code R](https://damieng.com/blog/2008/05/26/envy-code-r-preview-7-coding-font-released)
- [Iosevka](https://be5invis.github.io/Iosevka/)

SEEING Code Page 437 in Vim
Seeing Code Page 437 in Vim
---------------------------
`:e ++enc=cp437`

RESOURCES
Resources
---------
- [PabloDraw](http://picoe.ca/products/pablodraw/), an ANSI drawing program for Windows
- [ACiDDraw](http://www.acid.org/apps/apps.html), an ANSI drawing program for DOS
Expand All @@ -57,7 +59,7 @@ RESOURCES
https://en.wikipedia.org/wiki/ANSI_escape_code<br/>
https://www.gnu.org/software/screen/manual/html_node/Control-Sequences.html

MEDIA
Media
-----
- http://artscene.textfiles.com/ansi/
- https://www.ansilove.org/bbs.html
Expand Down
Loading

0 comments on commit b01a27d

Please sign in to comment.