Skip to content

Commit

Permalink
feat: add wasm and webui (#3)
Browse files Browse the repository at this point in the history
* add wasm and re-org code

* feat: add webui

* ci: add gh pages

* feat: add link

* test: add missing snapshots
  • Loading branch information
Enter-tainer authored Mar 14, 2024
1 parent c5598d8 commit 423c168
Show file tree
Hide file tree
Showing 27 changed files with 1,848 additions and 1,091 deletions.
55 changes: 55 additions & 0 deletions .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: GitHub Pages
on:
push:
branches:
- master
workflow_dispatch:

permissions:
pages: write
id-token: write
contents: read

# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "pages"
cancel-in-progress: false

jobs:
build-gh-pages:
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- uses: actions/checkout@v4
with: { submodules: recursive }
- uses: typst-community/setup-typst@v3
with: { typst-version: "0.10.0" }
- uses: rui314/setup-mold@v1
- uses: dtolnay/rust-toolchain@stable
with: { targets: wasm32-unknown-unknown }
- uses: jetli/[email protected]
with:
version: "v0.12.1"
- uses: mozilla-actions/[email protected]
- uses: actions/setup-node@v4
with:
node-version: 18
- run: |
wasm-pack build
- run: |
cd web
yarn
yarn build
- name: Setup Pages
uses: actions/configure-pages@v3
- name: Upload artifact
uses: actions/upload-pages-artifact@v1
with:
# Upload `/github-pages` sub directory
path: "web/dist"
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2
61 changes: 61 additions & 0 deletions Cargo.lock

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

3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,15 @@ path = "src/main.rs"
[lib]
name = "typst_geshihua"
path = "src/lib.rs"
crate-type = ["lib"]
crate-type = ["cdylib", "lib"]


[dependencies]
clap = { version = "4.5.2", features = ["derive", "env"] }
itertools = "0.12.1"
once_cell = "1.19.0"
pretty = "0.12.3"
wasm-bindgen = "0.2"
typst-syntax = { git = "https://github.com/typst/typst.git", tag = "v0.11.0-rc1" }

[dev-dependencies]
Expand Down
Loading

0 comments on commit 423c168

Please sign in to comment.