~alva/zlolcat

3812f5f458c7e1b0376ffc9b565e1cf143612291 — owl 1 year, 1 month ago dcfc45c
update readme and screenshot
M README.md => README.md +13 -6
@@ 1,6 1,5 @@
# zlolcat 😸 [![builds.sr.ht status](https://builds.sr.ht/~alva/zlolcat/commits/trunk.svg)](https://builds.sr.ht/~alva/zlolcat?)
it's a speedy and pretty little lolcat.
there's prebuilt executables in [`bin`](bin/), but windows and mac are untested.

originally based on [clolcat](https://github.com/IchMageBaume/clolcat), now it has diverged in some ways:
- multibyte characters and grapheme clusters are supported properly.


@@ 14,17 13,25 @@ but slower on some edge-cases.

![screenshot showing multibyte support and LCH colors](share/screenshot.png)

## limitations
grapheme clusters that require more than 4096 bytes of UTF-8 data will not work.
## install
there's prebuilt executables in [`bin`](bin/), but windows and mac are untested.
plop them somewhere on your `$PATH` and invoke `zlolcat` with something on `stdin`,
or `zlolcat file1 file2`.

## build it from source
use `zlolcat -h` to see all the options. to randomise the rainbow phase,
you can plug a random source in like `zlolcat -s$RANDOM`.

### build from source
[install latest zig](https://github.com/ziglang/zig/wiki/Install-Zig-from-a-Package-Manager)
and do `zig build install --prefix ~/.local -Doptimize=ReleaseSafe`.
and do `zig build install --prefix ~/.local -Doptimize=ReleaseFast`.

### build options
#### build options
you can specify how [ambiguous characters](https://unicode.org/reports/tr11/#Ambiguous)
should be handled, with `-Dambiguous=half` or `-Dambiguous=full`.

## limitations
grapheme clusters that require more than 4096 bytes of UTF-8 data will not work.

## acknowledgments
- color code is ported from the [colord typescript library](https://github.com/omgovich/colord).
- unicode support is thanks to [ziglyph](https://codeberg.org/dude_the_builder/ziglyph).

M bin/macos/aarch64/zlolcat => bin/macos/aarch64/zlolcat +0 -0
M bin/macos/x86_64/zlolcat => bin/macos/x86_64/zlolcat +0 -0
M bin/windows/aarch64/zlolcat.exe => bin/windows/aarch64/zlolcat.exe +0 -0
M bin/windows/x86_64/zlolcat.exe => bin/windows/x86_64/zlolcat.exe +0 -0
M build.zig => build.zig +2 -1
@@ 59,8 59,9 @@ pub fn build(b: *std.Build) void {
    if (target.os_tag == .windows)
        b.enable_wine = true;

    unit_tests.addModule("ziglyph", ziglyph.module("ziglyph"));
    unit_tests.addOptions("build-options", build_opts);
    unit_tests.addModule("clap", clap.module("clap"));
    unit_tests.addModule("ziglyph", ziglyph.module("ziglyph"));

    const run_unit_tests = b.addRunArtifact(unit_tests);


M share/screenshot.png => share/screenshot.png +0 -0
M x.sh => x.sh +3 -0
@@ 23,3 23,6 @@ for a in aarch64 x86_64; do
    done
done

for o in linux windows; do # macos doesn't work for some reason
    test_for_arch_and_os x86_64 "$o"
done