Skip to content

Commit

Permalink
context
Browse files Browse the repository at this point in the history
  • Loading branch information
alerque committed Dec 1, 2024
1 parent 3402474 commit 04a2267
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions typst/decasify.typ
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
str(_plugin.titlecase(bytes(s), bytes(l)))
}

#let titlecase(body, locale, limit: 4) = {
show regex(".{" + str(limit) + ",}"): it => string-to-titlecase(it.text, locale)
#let titlecase(body, limit: 4) = {
show regex(".{" + str(limit) + ",}"): it => string-to-titlecase(it.text, text.lang)

body
}
6 changes: 4 additions & 2 deletions typst/example.typ
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
"first impluse",
"ilk ışıltı",
) [
#s#titlecase(s, "en") \
#s#titlecase(s, "tr") \
#set text(lang: "en")
(#context(text.lang)) #s#titlecase(s) \
#set text(lang: "tr")
(#context(text.lang)) #s#titlecase(s) \
]

0 comments on commit 04a2267

Please sign in to comment.