splitans

command module
v0.11.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 9, 2026 License: GPL-3.0 Imports: 13 Imported by: 0

README

logo

Splitans is a tokenization tool that parses ANSI files and separates ANSI sequences from text. You can save the stdout output to a file with the .neo extension. The neotex format is simple: text content on the left, ANSI sequences on the right, separated by |. The neotex format allows you to view the content without requiring an ANSI terminal.

It is also possible to export to various formats, such as ANSI, table, stats or JSON.

Installation

export PATH="$HOME/go/bin:$PATH"
go install github.com/badele/splitans

Usage

By default, splitans converts UTF-8 ANSI to UTF-8 neotex format and outputs to stdout.

# Convert 16colors to UTF-8 ANSI (terminal)
curl -s https://16colo.rs/pack/1990/raw/WWANS157.ANS | splitans -e cp437 -F ansi

# Convert 16colors to UTF-8 ANSI with true VGA colors (disable terminal theme)
curl -s https://16colo.rs/pack/1990/raw/WWANS157.ANS | splitans -e cp437 -F ansi -V

# Convert 16colors legacy ANSI to neotex
curl -s https://16colo.rs/pack/1990/raw/WWANS157.ANS | splitans -e cp437 > /tmp/WWANS157.neo
less -S /tmp/WWANS157.neo

# Convert neotex to ANSI
splitans /tmp/WWANS157.neo -f neotex -F ansi
splitans /tmp/WWANS157.neo -f neotex -E cp437 -F ansi

# Convert 16colors to UTF-8 plaintext
splitans /tmp/WWANS157.neo -f neotex -F plaintext
cat /tmp/WWANS157.neo | colrm 80

# Copy ANSI to termbin.com
cat /tmp/WWANS157.neo | splitans -f neotex -F ansi | nc termbin.com 9999
curl -s https://termbin.com/w7sp

# Display ANSI tokens in other formats
curl -s https://16colo.rs/pack/1990/raw/WWANS157.ANS | splitans -e cp437 -F json
curl -s https://16colo.rs/pack/1990/raw/WWANS157.ANS | splitans -e cp437 -F table
curl -s https://16colo.rs/pack/1990/raw/WWANS157.ANS | splitans -e cp437 -F stats

# Stream ANSI output with delay (per character or per line)
cat /tmp/WWANS157.neo | splitans -f neotex -F ansi -d 50ms:c
cat /tmp/WWANS157.neo | splitans -f neotex -F ansi -d 120ms:l

Neotex Metadata

Metadata entries live in the sequence column and start with ! (for example !V1.2.0, !TW73/80, !NL42, !DC50ms, !DL120ms, or SAUCE labels like !STTitle). Use the short form !KEYvalue when the value has no separators, and the protected form !KEY<value> when it contains spaces or characters such as ;, ,, or :. Metadata values must not contain < or >; those are rejected on import.

Delay metadata uses !DC for per-character delay and !DL for per-line delay. When -d/--delay is not set, splitans uses the delay metadata when present.

Output Examples

Here are the results of the splitans commands, in order:

  • The neotex format
  • The 16-color ANSI format (uses the terminal theme)
  • The true color ANSI format (overrides the terminal theme)

Outputs comparisons

Miscellaneous

Convert all ANS files to neotex
# Convert one ANSI file to neotex
just neotex-from-ansi "<FILENAME>"

# Convert all *.ANS files to neotex
just neotex-all-delete "<PATH>"
just neotex-all-from-ansi "<PATH>"

Sources

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
internal
pkg
splitans
Package splitans provides a public API for parsing and exporting ANSI art files.
Package splitans provides a public API for parsing and exporting ANSI art files.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL