Skip to content

Commit b9f48cf

Browse files
committed
fix typos
1 parent 19abaf2 commit b9f48cf

2 files changed

Lines changed: 25 additions & 25 deletions

File tree

content/playground-how-it-works.md

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ sequenceDiagram
9595
Key details:
9696

9797
- **Pipeline execution**: each pipe stage is a fresh WASM instantiation. The stdout of one stage becomes the stdin of the next.
98-
- **Command dispatch**: every command goes through `["coreutils", command, ...args]` the WASM binary is a multicall binary, similar to BusyBox.
98+
- **Command dispatch**: every command goes through `["coreutils", command, ...args]` - the WASM binary is a multicall binary, similar to BusyBox.
9999
- **Path resolution**: relative paths are resolved against a virtual `cwd` maintained by the JS shell.
100100

101101
## WASM Loading & Initialization
@@ -140,21 +140,21 @@ flowchart LR
140140
</pre>
141141

142142
Supported shell features:
143-
- **Pipes** (`|`) chain commands together
144-
- **Redirections** (`>`, `>>`, `<`) write output to files, append, or read input from files
145-
- **Single quotes** (`'...'`) literal strings, no escaping
146-
- **Double quotes** (`"..."`) literal strings with backslash escaping
147-
- **Backslash escaping** (`\|`, `\ `) escape special characters
148-
- **Tab completion** commands and filenames
149-
- **Keyboard shortcuts** Ctrl+C (cancel), Ctrl+L (clear), Ctrl+U (clear line), arrows (history/cursor)
143+
- **Pipes** (`|`) - chain commands together
144+
- **Redirections** (`>`, `>>`, `<`) - write output to files, append, or read input from files
145+
- **Single quotes** (`'...'`) - literal strings, no escaping
146+
- **Double quotes** (`"..."`) - literal strings with backslash escaping
147+
- **Backslash escaping** (`\|`, `\ `) - escape special characters
148+
- **Tab completion** - commands and filenames
149+
- **Keyboard shortcuts** - Ctrl+C (cancel), Ctrl+L (clear), Ctrl+U (clear line), arrows (history/cursor)
150150

151151
**Not** supported (by design, to keep it simple): variables (`$VAR`), subshells, `&&`/`||`, globbing.
152152

153153
### Shell vs. Coreutils: Who Does What?
154154

155-
It's important to understand that **coreutils only provides individual commands** like `sort`, `cat`, `ls`, etc. Features like `if`/`then`/`else`, `while` loops, `for` loops, variable expansion (`$VAR`), and globbing (`*.txt`) are all **shell features** they are provided by a shell such as Bash or Zsh, not by coreutils.
155+
It's important to understand that **coreutils only provides individual commands** like `sort`, `cat`, `ls`, etc. Features like `if`/`then`/`else`, `while` loops, `for` loops, variable expansion (`$VAR`), and globbing (`*.txt`) are all **shell features** - they are provided by a shell such as Bash or Zsh, not by coreutils.
156156

157-
Since the playground implements only a minimal shell (pipes, redirections, quoting, and a few builtins), these shell constructs are not available. This isn't a limitation of uutils itself it's simply because the playground's JavaScript shell is intentionally lightweight and doesn't include a full shell language interpreter.
157+
Since the playground implements only a minimal shell (pipes, redirections, quoting, and a few builtins), these shell constructs are not available. This isn't a limitation of uutils itself - it's simply because the playground's JavaScript shell is intentionally lightweight and doesn't include a full shell language interpreter.
158158

159159
## The Rust Side: Building Coreutils for WebAssembly
160160

@@ -166,7 +166,7 @@ The uutils coreutils are compiled to **`wasm32-wasip1`** (WebAssembly System Int
166166
cargo build --target wasm32-wasip1 --features feat_wasm
167167
```
168168

169-
This produces a single `uutils.wasm` binary a **multicall binary** similar to BusyBox, where all 60+ utilities are bundled into one executable.
169+
This produces a single `uutils.wasm` binary - a **multicall binary** similar to BusyBox, where all 60+ utilities are bundled into one executable.
170170

171171
### The `feat_wasm` Feature Gate
172172

@@ -190,7 +190,7 @@ flowchart LR
190190
end
191191
</pre>
192192

193-
Utilities are excluded when they depend on OS-level syscalls not available in WASI for example, `df` needs filesystem stats, `du` needs directory traversal with metadata, and `chown`/`chcon` need permission and SELinux APIs.
193+
Utilities are excluded when they depend on OS-level syscalls not available in WASI - for example, `df` needs filesystem stats, `du` needs directory traversal with metadata, and `chown`/`chcon` need permission and SELinux APIs.
194194

195195
### Multicall Binary: How Command Dispatch Works
196196

@@ -215,8 +215,8 @@ type UtilityMap<T> = phf::OrderedMap<
215215
```
216216

217217
Each entry maps a utility name (e.g. `"sort"`) to a pair of functions:
218-
- **`uumain`** the utility's entry point, taking argument iterators and returning an exit code
219-
- **`uu_app`** returns the `clap::Command` definition for argument parsing and help
218+
- **`uumain`** - the utility's entry point, taking argument iterators and returning an exit code
219+
- **`uu_app`** - returns the `clap::Command` definition for argument parsing and help
220220

221221
At **runtime**, the multicall binary reads `argv` to determine which utility to invoke. In the browser, the JavaScript shell calls the WASM binary as `["coreutils", "sort", "-rn"]`, so `argv[1]` becomes the dispatch key.
222222

@@ -238,7 +238,7 @@ fn follow() { /* no-op stub */ }
238238
use hostname::get;
239239
```
240240

241-
These stubs mean the utilities gracefully degrade rather than crash `tail -f` simply won't follow, `cp` won't create symlinks, and `ls` won't show hostname information.
241+
These stubs mean the utilities gracefully degrade rather than crash - `tail -f` simply won't follow, `cp` won't create symlinks, and `ls` won't show hostname information.
242242

243243
### Localization: Embedding All Translations
244244

@@ -258,5 +258,5 @@ flowchart TB
258258
end
259259
</pre>
260260

261-
On native platforms, `uucore`'s build script embeds only the [Fluent](https://projectfluent.org/) (`.ftl`) translation files matching the user's `LANG` environment variable, to keep the binary small. For WASI builds, **all locale files are embedded**, because the target locale isn't known at compile time the playground user can switch languages at runtime via the locale dropdown or the `locale` command.
261+
On native platforms, `uucore`'s build script embeds only the [Fluent](https://projectfluent.org/) (`.ftl`) translation files matching the user's `LANG` environment variable, to keep the binary small. For WASI builds, **all locale files are embedded**, because the target locale isn't known at compile time - the playground user can switch languages at runtime via the locale dropdown or the `locale` command.
262262

content/playground.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title = "Playground"
33
template = "page.html"
44
+++
55

6-
<p>Try <a href="https://github.com/uutils/coreutils">uutils coreutils</a> directly in your browser! This interactive terminal runs Rust coreutils via WebAssembly no installation needed.</p>
6+
<p>Try <a href="https://github.com/uutils/coreutils">uutils coreutils</a> directly in your browser! This interactive terminal runs Rust coreutils via WebAssembly - no installation needed.</p>
77

88
<div class="playground-toolbar">
99
<label for="locale-select">Language:</label>
@@ -75,18 +75,18 @@ document.querySelectorAll('.playground-example').forEach(function(btn) {
7575

7676
## Sharing commands via URL
7777

78-
You can pre-fill the terminal with a command using the `?cmd=` URL parameter. The command runs automatically when the page loads great for sharing examples or linking from documentation.
78+
You can pre-fill the terminal with a command using the `?cmd=` URL parameter. The command runs automatically when the page loads - great for sharing examples or linking from documentation.
7979

8080
**Examples:**
8181

82-
- [`?cmd=date`](/playground?cmd=date) show the current date
83-
- [`?cmd=seq 1 10 | factor`](/playground?cmd=seq%201%2010%20|%20factor) factorize numbers 1–10
84-
- [`?cmd=echo 'Hello, world!' | sha256sum`](/playground?cmd=echo%20%27Hello%2C%20world!%27%20|%20sha256sum) hash a string
85-
- [`?cmd=sort fruits.txt | uniq -c | sort -rn`](/playground?cmd=sort%20fruits.txt%20|%20uniq%20-c%20|%20sort%20-rn) count and rank fruit
82+
- [`?cmd=date`](/playground?cmd=date) - show the current date
83+
- [`?cmd=seq 1 10 | factor`](/playground?cmd=seq%201%2010%20|%20factor) - factorize numbers 1–10
84+
- [`?cmd=echo 'Hello, world!' | sha256sum`](/playground?cmd=echo%20%27Hello%2C%20world!%27%20|%20sha256sum) - hash a string
85+
- [`?cmd=sort fruits.txt | uniq -c | sort -rn`](/playground?cmd=sort%20fruits.txt%20|%20uniq%20-c%20|%20sort%20-rn) - count and rank fruit
8686

8787
Multiple commands can be separated by newlines (`%0A` in the URL):
8888

89-
- [`?cmd=echo hello%0Aecho world`](/playground?cmd=echo%20hello%0Aecho%20world) run two commands in sequence
89+
- [`?cmd=echo hello%0Aecho world`](/playground?cmd=echo%20hello%0Aecho%20world) - run two commands in sequence
9090

9191
## Available commands
9292

@@ -105,8 +105,8 @@ The following commands run as **real Rust coreutils compiled to WebAssembly**:
105105

106106
The following are **shell builtins** implemented in JavaScript:
107107

108-
- `help` list available commands and examples
109-
- `clear` clear the terminal screen
108+
- `help` - list available commands and examples
109+
- `clear` - clear the terminal screen
110110

111111
Some commands (ex: `chcon`, `runcon`, etc) are not yet available in the WASM build because they
112112
depend on platform-specific syscalls not fully supported by WebAssembly/WASI yet.<br />

0 commit comments

Comments
 (0)