Skip to content

Commit 046d94a

Browse files
authored
Merge branch 'main' into chess
2 parents bd25462 + bb28c67 commit 046d94a

9 files changed

Lines changed: 1704 additions & 28 deletions

File tree

.github/workflows/ci.yml

Lines changed: 28 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,34 @@
11
name: Continuous integration
22
on: [push, pull_request]
33

4+
env:
5+
RUSTFLAGS: "-Dwarnings"
6+
RUSTDOCFLAGS: "-Dwarnings"
7+
8+
permissions:
9+
contents: read
10+
411
jobs:
5-
ci:
12+
tests:
13+
name: Tests
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
17+
- uses: dtolnay/rust-toolchain@e814c742d4444ce2f3f6abddea7faf00161ed941 # 1.88.0
18+
- uses: Swatinem/rust-cache@e18b497796c12c097a38f9edb9d0641fb99eee32 # v2
19+
- run: cargo test --workspace --all-features --no-run
20+
- run: cargo test --workspace --all-features --no-fail-fast
21+
- run: git diff --exit-code
22+
23+
checks:
24+
name: Check clippy, formatting, and documentation
625
runs-on: ubuntu-latest
726
steps:
8-
- uses: actions/checkout@v4
9-
- uses: dtolnay/rust-toolchain@stable
10-
- run: cargo build
11-
- run: cargo test --features=_test-unicode-conformance
27+
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
28+
- uses: dtolnay/rust-toolchain@e814c742d4444ce2f3f6abddea7faf00161ed941 # 1.88.0
29+
with:
30+
components: clippy, rustfmt
31+
- uses: Swatinem/rust-cache@e18b497796c12c097a38f9edb9d0641fb99eee32 # v2
32+
- run: cargo clippy --workspace --all-targets --all-features
33+
- run: cargo fmt --check --all
34+
- run: cargo doc --workspace --no-deps

CHANGELOG.md

Lines changed: 53 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,13 @@
55
### General changes
66

77
- Trivially updated to Unicode 17.0.0
8+
- Added numeral systems API under the `numeral-systems` feature flag
89

910
### New in `sym`
1011

12+
- Punctuation
13+
- `underscore`: _
14+
1115
- Mathematical symbols
1216
- `emptyset.zero`: ∅︀
1317
- `nothing.zero`: ∅︀
@@ -62,24 +66,64 @@
6266
- Currency
6367
- `riyal`: ⃁
6468

65-
- New `chess` submodule
69+
- New `sym.chess` submodule
6670
- `{king,queen,rook,bishop,knight,pawn}.{white,black,neutral}.{,inv,l,r}`
6771
- `knight.{white,black,neutral}.{tr,br,bl,tl}`
6872
- `equihopper.{white,black,neutral}.{,rot}`
6973
- `{amazon,empress,princess,ferz,alfil}.{white,black}`
7074
- `koma.{white,black}.{,inv}`
7175
- `{general,mandarin,elephant,horse,chariot,cannon,soldier}.{red,black}`
7276

77+
- Keyboard labels
78+
- `spacebar`: ␣
79+
80+
- Control (Printable symbols representing non-printable characters)
81+
- `nul`: ␀
82+
- `soh`: ␁
83+
- `stx`: ␂
84+
- `etx`: ␃
85+
- `eot`: ␄
86+
- `enq`: ␅
87+
- `ack`: ␆
88+
- `bel`: ␇
89+
- `bs`: ␈
90+
- `ht`: ␉
91+
- `lf`: ␊
92+
- `vt`: ␋
93+
- `ff`: ␌
94+
- `cr`: ␍
95+
- `so`: ␎
96+
- `si`: ␏
97+
- `dle`: ␐
98+
- `dc.one`: ␑
99+
- `dc.two`: ␒
100+
- `dc.three`: ␓
101+
- `dc.four`: ␔
102+
- `nak`: ␕
103+
- `syn`: ␖
104+
- `etb`: ␗
105+
- `can`: ␘
106+
- `em`: ␙
107+
- `sub`: ␚
108+
- `esc`: ␛
109+
- `fs`: ␜
110+
- `gs`: ␝
111+
- `rs`: ␞
112+
- `us`: ␟
113+
- `sp`: ␠
114+
- `del`: ␡
115+
- `nl`: ␤
116+
73117
### New in `emoji`
74118

75-
- bigfoot: 🫈
76-
- dancing.ballet: 🧑‍🩰
77-
- face.distorted: 🫪
78-
- fightcloud: 🫯
79-
- landslide: 🛘
80-
- orca: 🫍
81-
- treasure: 🪎
82-
- trombone: 🪊
119+
- `bigfoot`: 🫈
120+
- `dancing.ballet`: 🧑‍🩰
121+
- `face.distorted`: 🫪
122+
- `fightcloud`: 🫯
123+
- `landslide`: 🛘
124+
- `orca`: 🫍
125+
- `treasure`: 🪎
126+
- `trombone`: 🪊
83127

84128
### Deprecations in `sym`
85129

Cargo.lock

Lines changed: 115 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
[package]
22
name = "codex"
33
version = "0.2.0"
4+
rust-version = "1.88" # also change in ci.yml
45
authors = ["The Typst Project Developers"]
5-
edition = "2021"
6+
edition = "2024"
67
description = "Human-friendly notation for Unicode symbols."
78
repository = "https://github.com/typst/codex"
89
readme = "README.md"
@@ -11,9 +12,16 @@ categories = ["encoding", "text-processing"]
1112
keywords = ["unicode", "symbols"]
1213

1314
[features]
14-
default = ["styling"]
15+
default = ["numeral-systems", "styling"]
16+
numeral-systems = ["dep:chinese-number"]
1517
styling = []
1618
_test-unicode-conformance = ["ureq"]
1719

20+
[dependencies]
21+
chinese-number = { version = "0.7.7", default-features = false, features = ["number-to-chinese"], optional = true }
22+
23+
[dev-dependencies]
24+
siphasher = "1.0.2"
25+
1826
[build-dependencies]
1927
ureq = { version = "3.0.12", optional = true }

src/lib.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ pub use self::shared::ModifierSet;
1111

1212
mod shared;
1313

14+
#[cfg(feature = "numeral-systems")]
15+
pub mod numeral_systems;
16+
1417
#[cfg(feature = "styling")]
1518
pub mod styling;
1619

@@ -159,10 +162,7 @@ mod test {
159162
#[test]
160163
fn random_sample() {
161164
for (key, control) in [
162-
(
163-
"backslash",
164-
[("", "\\"), ("not", "⧷"), ("o", "⦸")].as_slice(),
165-
),
165+
("backslash", [("", "\\"), ("not", "⧷"), ("o", "⦸")].as_slice()),
166166
("chi", &[("", "χ")]),
167167
("forces", &[("", "⊩"), ("not", "⊮")]),
168168
("interleave", &[("", "⫴"), ("big", "⫼"), ("struck", "⫵")]),

0 commit comments

Comments
 (0)