Skip to content

Commit 9f5664f

Browse files
committed
doc: enhance README
1 parent f41dc19 commit 9f5664f

1 file changed

Lines changed: 15 additions & 35 deletions

File tree

README.md

Lines changed: 15 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,7 @@
88
99
## The Story
1010

11-
Picture this: you're writing a Rust CLI tool and you just want to pop up a little
12-
dialog that says _"hey, what's your name?"_ and take whatever the user types.
13-
Simple, right?
11+
Picture this: you're writing a Rust CLI tool and you just want to pop up a little dialog that says _"hey, what's your name?"_ and take whatever the user types. Simple, right?
1412

1513
So you look at the ecosystem.
1614

@@ -19,16 +17,13 @@ So you look at the ecosystem.
1917
- **`tinyfiledialogs`**: `input_box` looks promising! ...but why does my input box turn into a password input when `default` is empty (`Some("")`)? No multiline, no custom labels, no control over backends... Oh and it's a C binding.
2018
- **`dialog`**: Finally, an input box! ...but not for Windows or macOS. It fully depends on tools like `zenity`, `kdialog` or `dialog`.
2119

22-
You stare into the void. The void stares back. You write the dialog in HTML/JS
23-
because at least Electron works on all platforms.
20+
You stare into the void. The void stares back. You write the dialog in HTML/JS because at least Electron works on all platforms.
2421

2522
_Not anymore._
2623

2724
## What `inputbox` Does
2825

29-
`inputbox` is a minimal, cross-platform Rust library that shows a native GUI
30-
input dialog and returns what the user typed. It uses whatever is available on
31-
the system. Should work™ most of the time.
26+
`inputbox` is a minimal, cross-platform Rust library that shows a native GUI input dialog and returns what the user typed. It uses whatever is available on the system. Should work™ most of the time.
3227

3328
## Quick Start
3429

@@ -106,40 +101,25 @@ InputBox::new()
106101

107102
- **Multiple input modes** — text, password, or multiline
108103
- **Highly customizable** — title, prompt, button labels, dimensions, and more
109-
- **Works on most platforms** — Windows, macOS, Linux, Android, iOS nad OpenHarmony
104+
- **Works on most platforms** — Windows, macOS, Linux, Android, iOS and OpenHarmony
110105
- **Pluggable backends** — use a specific backend or let the library pick
111106
- **Synchronous and asynchronous** — safe sync on most platforms, async required on iOS
112107

113108
## Backends
114109

115-
| Backend | Platform | How it works |
116-
| ----------- | ----------- | ----------------------------------------------- |
117-
| `PSScript` | Windows | PowerShell + WinForms, no extra install needed |
118-
| `JXAScript` | macOS | `osascript` JXA, built into the OS |
119-
| `Android` | Android | AAR + JNI to show an Android AlertDialog |
120-
| `IOS` | iOS | UIKit alert |
121-
| `OHOS` | OpenHarmony | NAPI + ArkTS dialog |
122-
| `Yad` | Linux | [`yad`](https://github.com/v1cont/yad) |
123-
| `Zenity` | Linux | `zenity` — fallback on GNOME systems |
110+
| Backend | Platform | How it works | Extra setup |
111+
| ----------- | ----------- | ---------------------------------------------- | ----------------------------- |
112+
| `PSScript` | Windows | PowerShell + WinForms, no extra install needed | None |
113+
| `JXAScript` | macOS | `osascript` JXA, built into the OS | None |
114+
| `Android` | Android | AAR + JNI to show an Android AlertDialog | Include AAR in APK |
115+
| `IOS` | iOS | UIKit alert | None |
116+
| `OHOS` | OpenHarmony | NAPI + ArkTS dialog | See [OHOS setup](#ohos-setup) |
117+
| `Yad` | Linux | [`yad`](https://github.com/v1cont/yad) | Install `yad` |
118+
| `Zenity` | Linux | `zenity` — fallback on GNOME systems | Install `zenity` |
124119

125-
### Linux Installation
120+
### OHOS Setup
126121

127-
```bash
128-
# Arch Linux
129-
sudo pacman -S yad
130-
131-
# Debian/Ubuntu
132-
sudo apt install yad
133-
134-
# Fedora
135-
sudo dnf install yad
136-
137-
# or use zenity (usually pre-installed on GNOME)
138-
sudo apt install zenity
139-
```
140-
141-
The `show()` method automatically picks the best backend for the current platform.
142-
You can also specify one explicitly via `show_with()`.
122+
Currently you need to implement the ArkTS dialog yourself and use `registerInputboxCallback` to connect it to `inputbox`. See the [OHOS example](https://github.com/Mivik/inputbox/tree/main/examples/ohos) for setup details.
143123

144124
## License
145125

0 commit comments

Comments
 (0)