Skip to content

Commit 40bdb77

Browse files
Re-order README sections to be more fancy :)
1 parent 473d9d3 commit 40bdb77

File tree

1 file changed

+23
-6
lines changed

1 file changed

+23
-6
lines changed

README.md

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,22 @@
55
ruby.wasm is a collection of WebAssembly ports of the [CRuby](https://github.com/ruby/ruby).
66
It enables running Ruby application on browsers, WASI compatible WebAssembly runtimes, and Edge Computing platforms.
77

8-
## npm packages (for JavaScript host environments)
8+
## Try ruby.wasm (no installation needed)
99

10-
See the `README.md` of each package for more detail and its usage.
10+
Try ruby.wasm in [TryRuby](https://try.ruby-lang.org/playground/#code=3.times+do%0A++print+'Welcome+'%0Aend&engine=cruby-3.2.0dev) in your browser.
1111

12-
| Package | Description | npm |
13-
| ------------------------------------------------------------------------------ | ------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------- |
14-
| [ruby-head-wasm-wasi](./packages/npm-packages/ruby-head-wasm-wasi) | HEAD CRuby built on WASI with JS interop support | [![npm version](https://badge.fury.io/js/ruby-head-wasm-wasi.svg)](https://badge.fury.io/js/ruby-head-wasm-wasi) |
15-
| [ruby-head-wasm-emscripten](./packages/npm-packages/ruby-head-wasm-emscripten) | HEAD CRuby built on Emscripten (not well tested) | [![npm version](https://badge.fury.io/js/ruby-head-wasm-emscripten.svg)](https://badge.fury.io/js/ruby-head-wasm-emscripten) |
12+
## Quick Example: Ruby on browser
13+
14+
Create and save `index.html` page with the following contents:
15+
16+
```html
17+
<html>
18+
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/browser.script.iife.js"></script>
19+
<script type="text/ruby">
20+
puts "Hello, world!"
21+
</script>
22+
</html>
23+
```
1624

1725
## Quick Example: How to package your Ruby application as a WASI application
1826

@@ -38,6 +46,15 @@ $ wasmtime my-ruby-app.wasm -- /src/my_app.rb
3846
Hello
3947
```
4048

49+
## npm packages (for JavaScript host environments)
50+
51+
See the `README.md` of each package for more detail and its usage.
52+
53+
| Package | Description | npm |
54+
| ------------------------------------------------------------------------------ | ------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------- |
55+
| [ruby-head-wasm-wasi](./packages/npm-packages/ruby-head-wasm-wasi) | HEAD CRuby built on WASI with JS interop support | [![npm version](https://badge.fury.io/js/ruby-head-wasm-wasi.svg)](https://badge.fury.io/js/ruby-head-wasm-wasi) |
56+
| [ruby-head-wasm-emscripten](./packages/npm-packages/ruby-head-wasm-emscripten) | HEAD CRuby built on Emscripten (not well tested) | [![npm version](https://badge.fury.io/js/ruby-head-wasm-emscripten.svg)](https://badge.fury.io/js/ruby-head-wasm-emscripten) |
57+
4158
## Prebuilt binaries
4259

4360
This project distributes [prebuilt Ruby binaries in GitHub Releases](https://github.com/ruby/ruby.wasm/releases).

0 commit comments

Comments
 (0)