Skip to content

Commit b452004

Browse files
committed
chore(syntax)!: updated type checks
From Typst 0.8.0 release notes: > Types are now first-class values
1 parent 4faf667 commit b452004

File tree

5 files changed

+26
-9
lines changed

5 files changed

+26
-9
lines changed

CHANGELOG.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,18 @@ Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to
88

99
## [Unreleased]
1010

11+
## [0.10.0] - 2023-11-24
12+
13+
### Changed
14+
15+
- Values are now compared with "first-class values" types instead of strings
16+
(see [Typst 0.8.0 release notes](https://github.com/typst/typst/releases/tag/v0.8.0))
17+
(**breaking change**).
18+
19+
### Added
20+
21+
- Added minimal Typst version to `0.8.0` (see the reason above).
22+
1123
## [0.9.2] - 2023-09-14
1224

1325
### Fixed
@@ -34,6 +46,10 @@ Now kebab case is used instead of snake case.
3446

3547
Initial release.
3648

49+
[0.10.0]: https://github.com/Andrew15-5/rubby/releases/tag/v0.10.0
50+
51+
[0.9.2]: https://github.com/Andrew15-5/rubby/releases/tag/v0.9.2
52+
3753
[0.9.1]: https://github.com/Andrew15-5/rubby/releases/tag/v0.9.1
3854

3955
[0.9.0]: https://github.com/Andrew15-5/rubby/releases/tag/v0.9.0

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
## Usage
44

55
```typ
6-
#import "@preview/rubby:0.9.2": get-ruby
6+
#import "@preview/rubby:0.10.0": get-ruby
77
88
#let ruby = get-ruby(
99
size: 0.5em, // Ruby font size

example.typ

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
font: ("Liberation Sans", "Noto Sans CJK JP")
33
) // Optional
44

5-
#import "@preview/rubby:0.9.2": get-ruby
5+
#import "@preview/rubby:0.10.0": get-ruby
66
#let ruby = get-ruby()
77

88
```typst

rubby.typ

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,21 +29,21 @@
2929
)
3030
}
3131

32-
let rt-array = if type(rt) == "content" {
32+
let rt-array = if type(rt) == content {
3333
let (inner, func) = extract-content(rt)
3434
add-spacing-if-enabled(inner).split(delimiter).map(func)
35-
} else if type(rt) == "string" {
35+
} else if type(rt) == str {
3636
add-spacing-if-enabled(rt).split(delimiter)
3737
} else {(rt,)}
38-
assert(type(rt-array) == "array")
38+
assert(type(rt-array) == array)
3939

40-
let rb-array = if type(rb) == "content" {
40+
let rb-array = if type(rb) == content {
4141
let (inner, func) = extract-content(rb)
4242
add-spacing-if-enabled(inner).split(delimiter).map(func)
43-
} else if type(rb) == "string" {
43+
} else if type(rb) == str {
4444
add-spacing-if-enabled(rb).split(delimiter)
4545
} else {(rb,)}
46-
assert(type(rb-array) == "array")
46+
assert(type(rb-array) == array)
4747

4848
if rt-array.len() != rb-array.len() {
4949
rt-array = (rt,)

typst.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
[package]
22
name = "rubby"
3-
version = "0.9.2"
3+
version = "0.10.0"
44
entrypoint = "rubby.typ"
55
authors = ["Andrew Voynov"]
66
license = "AGPL-3.0-only"
77
description = "Add ruby (furigana) next to base text."
88
repository = "https://github.com/Andrew15-5/rubby"
99
keywords = ["ruby", "furigana", "CJK", "Chinese", "Japanese", "Korean"]
10+
compiler = "0.8.0"
1011
exclude = ["example.typ"]

0 commit comments

Comments
 (0)