#Typst ANSI Web: simple GUI to highlight Typst code

9 messages · Page 1 of 1 (latest)

severe halo
#

After some user feedback (#quick-questions message), I've made this webpage to expose a simple GUI for @novel pecan 's tool to highlight Typst code using ANSI colors:

https://pgbiel.github.io/typst-ansi-web/

Given the lack of built-in typst codeblocks, frozolotl's tool allows highlighting Typst code on Discord by pasting the output into ```ansi ...``` codeblocks, which is pretty cool. Taking the example from the image:

#context [hi]

I had made a desktop gui for it before for fun (https://github.com/pgbiel/typst-ansi-gui), but its website version didn't work very well (and required WebGPU, severely limiting platform support), so I made this simpler version which should work on most devices and browsers. Let me know what you think!

Current TODOs:

  • Dark theme
  • More configuration
  • "Copy (Discord)" button to copy with the codeblock itself, including backtick escaping
bitter maple
#

So nice! Will try to contribute later on

worthy anvil
#

very nice!!!! i didn't even know ansi codeblocks existed

dusk epoch
#

why dont you make a monkeyscript for webapp to select and copy code as ansi?

distant whale
#

rather a script that replaces Typst code blocks with ansi ones

cinder kayak
#

Does it copy with ```ansi ?

distant whale
#

Not yet

#

Check the todo list

severe halo