Skip to content

Commit

Permalink
docs: simplify usage section, reference lib.zig
Browse files Browse the repository at this point in the history
  • Loading branch information
ttytm committed Oct 19, 2024
1 parent 663699e commit 68432a0
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,7 @@ const std = @import("std");
pub fn build(b: *std.Build) void {
// ..
const osdialog_dep = b.dependency("osdialog", .{
.target = target,
.optimize = optimize,
});
const osdialog_dep = b.dependency("osdialog", .{});
const exe = b.addExecutable(.{
.name = "your-awesome-projct",
// ..
Expand All @@ -100,6 +97,7 @@ pub fn build(b: *std.Build) void {

## Usage

Ref.: [`osdialog-zig/src/lib.zig`](https://github.com/ttytm/osdialog-zig/blob/main/src/lib.zig)
```zig
/// Opens a message box and returns `true` if `OK` or `Yes` was pressed.
pub fn message(text: [*:0]const u8, opts: MessageOptions) bool
Expand All @@ -113,7 +111,7 @@ pub fn prompt(allocator: std.mem.Allocator, text: [*:0]const u8, opts: PromptOpt
pub fn color(options: ColorPickerOptions) ?Color
/// Opens a file dialog and returns the selected path or `null` if the selection was canceled.
pub fn path(allocator: std.mem.Allocator, action: enum { open, open_dir, save }, options: PathOptions) ?[:0]u8
pub fn path(allocator: std.mem.Allocator, action: PathAction, options: PathOptions) ?[:0]u8
```

### Example
Expand Down

0 comments on commit 68432a0

Please sign in to comment.