Wardian docs

Text tools

Try it

The app runs here in your browser. Nothing you type leaves it. Open it on its own.

Download text-tools.wardian Import it in Wardian: Settings → Import.

For anyone checking a piece of writing: type, paste or open a text file, and see at once how long it is, how long it takes to read, which words it leans on, its SHA-256 hash, and the same text in another case. WebAssembly does the work on every key press; nothing leaves the browser.

What you put in#

InputTypeUnitAllowedDefaultRequired
Textlong textcharactersany length; a file up to 25 MBa sample passage, labelledoptional (empty shows empty states)
Open file…a filea text file (.txt, .md, .csv, .json, .log and other text/*), up to 25 MB, UTF-8optional
Showone of 10, 25, 50, 100words10required
Skip common wordson or offon
Caseone of UPPER, lower, Title Case, Sentence case, url-slugUPPER

What it shows#

How it behaves#

Layout#

Two columns that Arrange may swap or join; one column under 820px. Reading order and tab order:

  1. Text (side): the source badge (Sample text, Typed text, or the file's name), the text box (textarea, size-full, 14 rows, resizable), its hint, then Open file… (input type="file" with accept, behind the button), Sample text, Clear. File errors appear in the hint under the box, marked aria-invalid on the box while they apply.
  2. Counts (main): a grid of figures, the timing note; empty state "Type, paste or open a text to count it."
  3. Top words (main): the radio group Show (10, 25, 50, 100 words), the switch Skip common words, then the table (num on the rank and count).
  4. Change case (main): the case tabs, the result, Copy and Download .txt.
  5. SHA-256 (main): what it is a hash of, the hash, Copy.

Files#

FileWhat it is
index.htmlThe page: the text box and four panels.
app.jsOne parser per input (the file, the word limit), the copying of text into the module, and the drawing.
src/lib.rsstats, top_words, sha256, change_case, plus alloc, dealloc and out_ptr. SHA-256 is written out in full, with no crates. Unit tests at the end.
app.wasmBuilt from src/lib.rs by ./build.sh.
ui/The Wardian component library.

How data moves, once per change: app.js encodes the text as UTF-8, asks the module for space with alloc(len), copies the bytes in once, calls stats, top_words, change_case and sha256 on the same address, reads each answer at out_ptr() (reading memory.buffer again after every call, because a call can grow memory), and frees the space with dealloc.

Limits:

Change it: edit src/lib.rs and app.js, run cargo test, run ./build.sh, then wardian check ..

This page is apps/text-tools/README.md in the repository. Something wrong or missing? Change that file.