|
1 | 1 | # unicode-math-class for WebAssembly |
2 | 2 |
|
3 | | -🦀 [unicode-math-class] Rust crate compiled to a [WebAssembly component] |
| 3 | +🦀 [unicode-math-class](https://crates.io/crates/unicode-math-class) Rust crate compiled to a [WebAssembly component](https://github.com/WebAssembly/component-model) |
4 | 4 |
|
5 | | -<p align=center> |
| 5 | +<table align=center><td> |
| 6 | + |
| 7 | +```js |
| 8 | +assert.equal(class('0'), "normal")); |
| 9 | +assert.equal(class('a'), "alphabetic"); |
| 10 | +assert.equal(class('('), "opening"); |
| 11 | +assert.equal(class('😃'), null); |
| 12 | +``` |
6 | 13 |
|
| 14 | +</table> |
| 15 | + |
| 16 | +<p align=center> |
| 17 | + <a href="https://jcbhmr.me/unicode-math-class.wasm/">Docs</a> |
| 18 | + | <a href="https://github.com/jcbhmr/unicode-math-class.wasm/releases/latest/download/unicode-math-class.wasm">Download</a> |
7 | 19 | </p> |
8 | 20 |
|
9 | | -🏷️ Uses [unicode-math-class] v0.1.0 \ |
| 21 | +🏷️ Uses [unicode-math-class](https://crates.io/crates/unicode-math-class) v0.1.0 \ |
10 | 22 | 🟪 Distributed as WebAssembly to run anywhere \ |
11 | | -🤝 Composes well with other WebAssembly components |
| 23 | +🤝 Composes well with other WebAssembly components \ |
| 24 | +0️⃣ Zero dependencies |
12 | 25 |
|
13 | | -**👀 You might be looking for the [JavaScript bindings] or the [Python |
14 | | -bindings].** |
| 26 | +👀 You might be looking for the premade bindings [for JavaScript](#TODO) or [for Python](#TODO). |
15 | 27 |
|
16 | 28 | ## Usage |
17 | 29 |
|
18 | 30 |  |
19 | 31 |
|
20 | | -You can download the [unicode-math-class.wasm] WebAssembly component file from |
21 | | -[this repository's GitHub releases page]. To actually _use_ the WebAssembly |
22 | | -component, you'll need to use a [WebAssembly component host runtime]. |
| 32 | +You can download the [unicode-math-class.wasm](https://github.com/jcbhmr/unicode-math-class.wasm/releases/latest/download/unicode-math-class.wasm) WebAssembly component file from [this repository's GitHub releases page](https://github.com/jcbhmr/unicode-math-class.wasm/releases). To actually _use_ the WebAssembly component, you'll need to use a [WebAssembly component host runtime](https://github.com/jcbhmr/awesome-webassembly-runtimes#readme). |
23 | 33 |
|
24 | | -[]() |
| 34 | +[](https://github.com/jcbhmr/unicode-math-class.wasm/releases/latest/download/unicode-math-class.wasm) |
| 35 | + |
| 36 | +How you use consume the [WIT-defined API](https://jcbhmr.me/unicode-math-class.wasm/) is determined by which [bindings generator](https://github.com/bytecodealliance/wit-bindgen) you use. |
25 | 37 |
|
26 | 38 | ## Development |
27 | 39 |
|
28 | 40 |  |
29 | 41 |  |
30 | | - |
31 | 42 |
|
32 | 43 | Run `make setup` or install these additional tools: |
33 | 44 |
|
34 | 45 | - Rust `wasm32-unknown-unknown` target |
35 | 46 | - [`cargo component`](https://github.com/bytecodealliance/cargo-component) |
36 | | -- [Node.js](https://nodejs.org/en) |
37 | | -- [jco](https://github.com/bytecodealliance/jco) |
38 | | -- [Deno](https://deno.com/) |
39 | | -- [Bun](https://bun.sh/) |
40 | 47 | - [`wit-bindgen` CLI](https://github.com/bytecodealliance/wit-bindgen#cli-installation) |
41 | 48 | - [Static Web Server](https://static-web-server.net/) |
| 49 | +- [`wasm-tools`](https://github.com/bytecodealliance/wasm-tools) |
42 | 50 |
|
43 | | -You can run `make build` to build the `.wasm` file. Use `make test` to test |
44 | | -using it in JavaScript and Rust. Use `make build-docs` to build the docs. Run |
45 | | -[the `make publish` workflow] or use `make publish` to create new releases. |
46 | | - |
47 | | -<!-- prettier-ignore-start --> |
48 | | -[the `make publish` workflow]: https://github.com/jcbhmr/unicode-math-class.wasm/actions/workflows/make-publish.yml |
49 | | -[unicode-math-class]: https://crates.io/crates/unicode-math-class |
50 | | - |
51 | | -<!-- prettier-ignore-end --> |
| 51 | +You can run `make build` to build the `.wasm` file. Use `make build-docs` to build the docs. Run [the `make publish` workflow](https://github.com/jcbhmr/unicode-math-class.wasm/actions/workflows/make-publish.yml) or use `make publish` to create new releases. |
0 commit comments