Skip to content

Commit

Permalink
fix: warnings in typst v0.12.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Myriad-Dreamin committed Oct 21, 2024
1 parent f1f20f7 commit 8ba6b53
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 15 deletions.
4 changes: 2 additions & 2 deletions contrib/typst/gh-pages.typ
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@
#let main-font = (
"Charter",
"Source Han Serif SC",
"Source Han Serif TC",
// "Source Han Serif TC",
// shiroa's embedded font
"Linux Libertine",
"Libertinus Serif",
)
#let code-font = (
"BlexMono Nerd Font Mono",
Expand Down
8 changes: 4 additions & 4 deletions packages/shiroa/supports-link.typ
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,15 @@
}

assert(content != none, message: "invalid label content")
locate(loc => {
let link-result = link2page.final(loc)
context {
let link-result = link2page.final()
if path-lbl in link-result {
link((page: link-result.at(path-lbl), x: 0pt, y: 0pt), content)
return
}

if reference != none {
let result = query(reference, loc)
let result = query(reference)
// whether it is internal link
if result.len() > 0 {
link(reference, content)
Expand All @@ -61,5 +61,5 @@
},
content,
)
})
}
}
20 changes: 11 additions & 9 deletions packages/shiroa/utils.typ
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@

#import "supports-text.typ": plain-text

#let _labeled-meta(label) = locate(loc => {
let res = query(label, loc)
if res.len() <= 0 {
none
} else if res.len() == 1 {
res.at(0).value
} else {
res.map(it => it.value)
#let _labeled-meta(label) = (
context {
let res = query(label)
if res.len() <= 0 {
none
} else if res.len() == 1 {
res.at(0).value
} else {
res.map(it => it.value)
}
}
})
)

#let _store-content(ct) = (
kind: "plain-text",
Expand Down

0 comments on commit 8ba6b53

Please sign in to comment.