From 260078a8373e6145c1c617be62a79b78876c1f14 Mon Sep 17 00:00:00 2001 From: Hung-I Wang Date: Wed, 27 Nov 2024 15:33:42 +0800 Subject: [PATCH] bump CI --- .github/workflows/main.yml | 23 +++++++++++++++++++++++ .github/workflows/pyo3.yml | 2 +- typst/Cargo.lock | 7 ------- typst/example.typ | 37 +++++++++++++++++++++++++++++++++++++ 4 files changed, 61 insertions(+), 8 deletions(-) create mode 100644 typst/example.typ diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index aa74e07..980a5e2 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -63,6 +63,29 @@ jobs: command: build args: --release --sdist -o pyo3/dist --find-interpreter -m pyo3/Cargo.toml + build-typst: + needs: build-main + runs-on: ubuntu-latest + defaults: + run: + working-directory: typst/ + steps: + - uses: actions/checkout@v3 + - name: Build + run: | + cargo --version + cargo build --release --verbose --target wasm32-unknown-unknown + - name: Test + run: cargo test --verbose --target wasm32-unknown-unknown + - name: Clippy + run: cargo clippy --target wasm32-unknown-unknown --all-features -- -D warnings + - name: Check Format + run: cargo fmt -- --check + - name: Install Typst: + run: curl -fsSL https://typst.community/typst-install/install.sh | sh + - name: Typst Compile + run: typst compile example.typ + # now Pages.dev do this for us # build-web: # needs: build-main diff --git a/.github/workflows/pyo3.yml b/.github/workflows/pyo3.yml index f91a2dc..378263c 100644 --- a/.github/workflows/pyo3.yml +++ b/.github/workflows/pyo3.yml @@ -8,7 +8,7 @@ name: PyO3 on: push: branches: - - main + # - main - dev tags: - 'v*' diff --git a/typst/Cargo.lock b/typst/Cargo.lock index 9224fb2..816da68 100644 --- a/typst/Cargo.lock +++ b/typst/Cargo.lock @@ -155,12 +155,6 @@ dependencies = [ "libc", ] -[[package]] -name = "lazy_static" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" - [[package]] name = "libc" version = "0.2.164" @@ -506,7 +500,6 @@ dependencies = [ "daachorse", "hex-literal", "itertools", - "lazy_static", "once_cell", "regex", "ruzstd", diff --git a/typst/example.typ b/typst/example.typ new file mode 100644 index 0000000..ce1d8b1 --- /dev/null +++ b/typst/example.typ @@ -0,0 +1,37 @@ +#set text(font: "Source Han Serif") + +#align(center, text(22pt, weight: "bold")[ + zhconv-rs 中文简繁及地區詞轉換 +]) + += Usage +At first: +`#import "@preview/zhconv:0.0.0": zhconv` +// #import "@preview/zhconv:0.0.0": zhconv +#import "zhconv.typ": zhconv + +#box(stroke: red, +`#zhconv([ +柳外輕雷池上雨 +雨聲滴碎荷聲 +小樓西角斷虹明 +闌乾倚處 +待得月華生 +], "zh-hans")` +) + +#zhconv([ +柳外輕雷池上雨 +雨聲滴碎荷聲 +小樓西角斷虹明 +闌乾倚處 +待得月華生 +], "zh-tw") + +#zhconv([ +柳外輕雷池上雨 \ +雨聲滴碎荷聲 \ +小樓西角斷虹明 \ +闌干倚處 \ +待得月華生 \ +], "zh-hans") \ No newline at end of file