zellzig/README.md

42 lines
1.1 KiB
Markdown
Raw Permalink Normal View History

2022-06-11 23:52:21 +02:00
# zellzig
A zig framework for writing [zellij](https://zellij.dev/) plugins.
2022-06-28 20:49:01 +02:00
Zellzig is currently used by these project (if you use this library, please submit a PR!):
- [zellij-compact-status](https://mzte.de/git/LordMZTE/zellij-compact-status)
2022-06-11 23:52:21 +02:00
# usage
For an example of how to use it, see the example directory.
Also note that you'll need a master version of the zig compiler to use zellzig.
2022-06-11 23:52:21 +02:00
Here's a quick overview:
```zig
const std = @import("std");
const zz = @import("zellzig");
comptime {
// register plugin
zz.createPlugin(@This());
}
pub fn init() void {
// do initialization stuff
}
pub fn update() void {
var event = zz.getEvent(my_allocator) catch return;
defer event.deinit();
2022-06-11 23:52:21 +02:00
// handle events
}
pub fn render(rows: i32, cols: i32) void {
// draw UI
}
```
# development
PRs are always welcome if you feel that something needs improvement/fixing! Make sure to follow [Conventional Commits](https://www.conventionalcommits.org/) and to run tests first, though.
Run tests using `gyro build test`. Note that tests are run on the native target, not WASM.
2022-08-23 18:25:20 +02:00
Documentation may be generated by running `gyro build -Ddocs`.