AshlinHarris / Spinners.jl

Command line spinners in Julia with Unicode support
MIT License
14 stars 1 forks source link

Add visualisations for all spinners #51

Open curio-sitas opened 1 year ago

curio-sitas commented 1 year ago

As more and more spinners with their own identifier will be added, it may be appropriate to create an automated (CI at build time ?) visual gallery showing each spinner associated with its identifier; It is easier than going through code to find the spinner of interest as well as testing dozens of them.

AshlinHarris commented 1 year ago

Agreed!

I made the examples on the README manually with a screen capture, which is fine for a short curated list. Generating a complete list would be great for users, as well as for testing.

I guess something like REPLay.jl is best for automating this. I haven't used any tool like that, and I'm hoping there's a way to disable the typing effect for the input command.

AshlinHarris commented 1 year ago

The Replay.jl README recommends using asciinema for generating animations from terminal output:

$ pip3 install asciinema # install `asciinema`
$ asciinema rec output.cast --command "julia examples/helloworld/app.jl"
$ asciinema play output.cast
curio-sitas commented 1 year ago

The Replay.jl README recommends using asciinema for generating animations from terminal output:

$ pip3 install asciinema # install `asciinema`
$ asciinema rec output.cast --command "julia examples/helloworld/app.jl"
$ asciinema play output.cast

Yeah i saw their examples, but i searched up for a more julian approach without calling other tools. But i ended up to the conclusion that there is no package capable of drawing utf emojis...

But we could add the Replay.jl way of doing it in the CI, i'll do some tests

curio-sitas commented 1 year ago

I manage to use Replay.jl

I observed that :

I will search a way to avoid printing the julia header as well as the package loading command line.

I will create a standalone julia script, a shell script and a custom Github workflow to loop over all the spinner definitions. Note that this has to be run during CI in order to use julia, python and rust to generate gifs. In the future, the documentation will have to print these gifs after they have been generated.

Ideally, one would want to launch asciinema during an existing julia session, maybe using PyCall ?

Gif result after using julia+asciinema+agg :

test

curio-sitas commented 1 year ago

Asciinema works fine ! As we can see on the uploaded version : asciicast

But agg does not manage to print emojis... More research to do ! This is related to the fonts used to generate the image.

test

curio-sitas commented 1 year ago

Tried on a native Unix machine (Linux Manjaro) but presented the same problem as on WIndows. The aggprogram do not manage to draw emojis (even with a fallback font). One should consider to use asciinema's online API to generate the visuals