Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
70 changes: 70 additions & 0 deletions .github/workflows/deploy-demo.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
name: Deploy Web Demo

on:
push:
branches: [ main ]
paths:
- 'web-demo/**'
- 'doublets/**'
- '.github/workflows/deploy-demo.yml'
pull_request:
branches: [ main ]
paths:
- 'web-demo/**'
- 'doublets/**'
workflow_dispatch:

jobs:
deploy:
runs-on: ubuntu-latest
permissions:
contents: read
pages: write
id-token: write

environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
target: wasm32-unknown-unknown
override: true

- name: Install wasm-pack
run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh

- name: Cache cargo dependencies
uses: actions/cache@v3
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}

- name: Build web demo
run: |
cd web-demo
wasm-pack build --target web --out-dir pkg

- name: Setup Pages
if: github.ref == 'refs/heads/main'
uses: actions/configure-pages@v3

- name: Upload artifact
if: github.ref == 'refs/heads/main'
uses: actions/upload-pages-artifact@v2
with:
path: ./web-demo

- name: Deploy to GitHub Pages
if: github.ref == 'refs/heads/main'
id: deployment
uses: actions/deploy-pages@v2
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
target/
114 changes: 85 additions & 29 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ members = [
"doublets-ffi",
"doublets",

# web demo
"web-demo",

# dev
"dev-deps/mem-rs",
"dev-deps/data-rs",
Expand Down
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,16 @@ later

later

## Web Demo

Try the interactive WebAssembly demo: [**πŸ”— Doublets Playground**](https://linksplatform.github.io/doublets-rs/)

The web demo allows you to:
- Create and manage doublets interactively
- Explore link relationships visually
- Learn doublets concepts in your browser
- See real-time operations and results

## Example

A basic operations in doublets:
Expand Down
Loading
Loading