mirror of
https://github.com/ghostty-org/ghostty.git
synced 2026-04-27 17:53:55 +00:00
example/zig-formatter: show how to use formatters from libghostty (#9407)
This commit is contained in:
committed by
GitHub
parent
c0e483c49e
commit
4a88976ef9
24
example/zig-formatter/README.md
Normal file
24
example/zig-formatter/README.md
Normal file
@@ -0,0 +1,24 @@
|
||||
# Example: stdin to HTML using `vtStream` and `TerminalFormatter`
|
||||
|
||||
This example demonstrates how to read VT sequences from stdin, parse them
|
||||
using `vtStream`, and output styled HTML using `TerminalFormatter`. The
|
||||
purpose of this example is primarily to show how to use formatters with
|
||||
terminals.
|
||||
|
||||
Requires the Zig version stated in the `build.zig.zon` file.
|
||||
|
||||
## Usage
|
||||
|
||||
Basic usage:
|
||||
|
||||
```shell-session
|
||||
echo -e "Hello \033[1;32mGreen\033[0m World" | zig build run
|
||||
```
|
||||
|
||||
This will output HTML with inline styles and CSS palette variables.
|
||||
|
||||
You can also pipe complex terminal output:
|
||||
|
||||
```shell-session
|
||||
ls --color=always | zig build run > output.html
|
||||
```
|
||||
Reference in New Issue
Block a user