chore: typst 0.13 updates (#113)

* chore: upgrade linguify

* chore: update tests

* fix: remove deprecated type checks

* chore: improve Justfile docs

* chore: compile with typst 0.12 and 0.13 in CI

* chore: use tytanic for testing

* chore: use tytanic in CI

* fix: don't use ubuntu-latest

* fix: test runner issues

* chore: trying to fix CI issues

* fix: remove unused font in tests

* fix: update references
This commit is contained in:
Paul T
2025-03-29 08:12:19 -04:00
committed by GitHub
parent beff2b2b4b
commit 12352d79bd
7 changed files with 54 additions and 35 deletions

View File

@@ -14,7 +14,7 @@ env:
jobs: jobs:
release: release:
runs-on: ubuntu-latest runs-on: ubuntu-22.04
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v4 uses: actions/checkout@v4

View File

@@ -10,13 +10,13 @@ jobs:
strategy: strategy:
matrix: matrix:
# add any other Typst versions that your package should support # add any other Typst versions that your package should support
typst-version: ["0.12"] typst-version: ["0.12", "0.13"]
# the docs don't need to build with all versions supported by the package; # the docs don't need to build with all versions supported by the package;
# the latest one is enough # the latest one is enough
include: include:
- typst-version: "0.12" - typst-version: "0.13"
doc: 1 doc: 1
runs-on: ubuntu-latest runs-on: ubuntu-22.04
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v4 uses: actions/checkout@v4
@@ -37,12 +37,10 @@ jobs:
with: with:
crate: just crate: just
- name: Install typst-test from github - name: Install tytanic from github
uses: baptiste0928/cargo-install@v3 uses: baptiste0928/cargo-install@v3
with: with:
crate: typst-test crate: tytanic
git: https://github.com/tingerrr/typst-test.git
tag: ci-semi-stable
- name: Setup typst - name: Setup typst
uses: typst-community/setup-typst@v3 uses: typst-community/setup-typst@v3
@@ -55,6 +53,7 @@ jobs:
sudo apt-get install fonts-roboto sudo apt-get install fonts-roboto
./scripts/install-fontawesome ./scripts/install-fontawesome
./scripts/install-source-sans ./scripts/install-source-sans
typst fonts
- name: Install locally - name: Install locally
run: just install run: just install

View File

@@ -7,39 +7,51 @@ default:
@just --list --unsorted @just --list --unsorted
# generate manual # generate manual
[doc('Generate package documentation')]
[group('package')]
doc: doc:
typst compile docs/manual.typ docs/manual.pdf typst compile docs/manual.typ docs/manual.pdf
# run test suite [doc('Run test suite. Requires tytanic.')]
test *args: [group('dev')]
typst-test run {{ args }} test *args: install
tt run {{ args }} --use-system-fonts --no-fail-fast
# update test cases [doc('Update test cases. Requires tytanic.')]
[group('dev')]
update *args: update *args:
typst-test update {{ args }} tt update {{ args }} --use-system-fonts
# package the library into the specified destination folder [doc('Package the library into the specified destination folder')]
[group('package')]
package target: package target:
./scripts/package "{{target}}" ./scripts/package "{{target}}"
# install the library with the "@local" prefix [doc('Install the library with the "@local" prefix')]
[group('dev')]
install: (package "@local") install: (package "@local")
# install the library with the "@preview" prefix (for pre-release testing) [doc('Install the library with the "@preview" prefix (for pre-release testing)')]
[group('dev')]
install-preview: (package "@preview") install-preview: (package "@preview")
[private] [private]
remove target: remove target:
./scripts/uninstall "{{target}}" ./scripts/uninstall "{{target}}"
# uninstalls the library from the "@local" prefix [doc('Uninstall the library from the "@local" prefix')]
[group('dev')]
uninstall: (remove "@local") uninstall: (remove "@local")
# uninstalls the library from the "@preview" prefix (for pre-release testing) [doc('Uninstall the library from the "@preview" prefix (for pre-release testing)')]
[group('dev')]
uninstall-preview: (remove "@preview") uninstall-preview: (remove "@preview")
[doc('Format the source code. Requires typstyle.')]
[group('dev')]
format: format:
./scripts/format ./scripts/format
# run ci suite [doc('Run ci suite')]
[group('dev')]
ci: test doc ci: test doc

32
lib.typ
View File

@@ -1,5 +1,5 @@
#import "@preview/fontawesome:0.5.0": * #import "@preview/fontawesome:0.5.0": *
#import "@preview/linguify:0.4.1": * #import "@preview/linguify:0.4.2": *
// const color // const color
#let color-darknight = rgb("#131A28") #let color-darknight = rgb("#131A28")
@@ -230,7 +230,7 @@
} }
let lang_data = toml("lang.toml") let lang_data = toml("lang.toml")
show: body => context { show: body => context {
set document( set document(
author: author.firstname + " " + author.lastname, author: author.firstname + " " + author.lastname,
@@ -238,7 +238,7 @@
) )
body body
} }
set text( set text(
font: font, font: font,
lang: language, lang: language,
@@ -464,9 +464,8 @@
address address
contacts contacts
} }
body body
} }
/// The base item for resume entries. /// The base item for resume entries.
@@ -618,15 +617,19 @@
if closing == none { if closing == none {
closing = default-closing(lang_data) closing = default-closing(lang_data)
} }
show: body => context { show: body => context {
set document( set document(
author: author.firstname + " " + author.lastname, author: author.firstname + " " + author.lastname,
title: lflib._linguify("cover-letter", lang: language, from: lang_data).ok, title: lflib._linguify(
"cover-letter",
lang: language,
from: lang_data,
).ok,
) )
body body
} }
set text( set text(
font: font, font: font,
lang: language, lang: language,
@@ -731,9 +734,9 @@
let contacts = { let contacts = {
set box(height: 9pt) set box(height: 9pt)
let separator = [ #box(sym.bar.v) ] let separator = [ #box(sym.bar.v) ]
let author_list = () let author_list = ()
if ("phone" in author) { if ("phone" in author) {
author_list.push[ author_list.push[
#phone-icon #phone-icon
@@ -772,8 +775,8 @@
#box[#link(author.website)[#author.website]] #box[#link(author.website)[#author.website]]
] ]
} }
align(right)[ align(right)[
#set text( #set text(
size: 8pt, size: 8pt,
@@ -862,7 +865,10 @@
// TODO: Make this adaptable to content // TODO: Make this adaptable to content
underline(evade: false, stroke: 0.5pt, offset: 0.3em)[ underline(evade: false, stroke: 0.5pt, offset: 0.3em)[
#text(weight: "bold", size: 12pt)[#linguify("letter-position-pretext", from: lang_data) #job-position] #text(weight: "bold", size: 12pt)[#linguify(
"letter-position-pretext",
from: lang_data,
) #job-position]
] ]
pad(top: 1em, bottom: 1em)[ pad(top: 1em, bottom: 1em)[
#text(weight: "light", fill: color-gray)[ #text(weight: "light", fill: color-gray)[

View File

@@ -1,7 +1,7 @@
#import "@local/modern-cv:0.8.0": * #import "@local/modern-cv:0.8.0": *
// setup the document like we do for the resume // setup the document like we do for the resume
#let font = ("Source Sans Pro", "Source Sans 3") #let font = ("Source Sans 3")
#set text( #set text(
font: font, font: font,
size: 11pt, size: 11pt,

Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

After

Width:  |  Height:  |  Size: 24 KiB

View File

@@ -1,7 +1,7 @@
#import "@local/modern-cv:0.8.0": * #import "@local/modern-cv:0.8.0": *
// setup the document like we do for the resume // setup the document like we do for the resume
#let font = ("Source Sans Pro", "Source Sans 3") #let font = ("Source Sans 3")
#set text( #set text(
font: font, font: font,
size: 11pt, size: 11pt,
@@ -80,9 +80,11 @@
#birth-icon #birth-icon
#homepage-icon #homepage-icon
#website-icon #website-icon
#gitlab-icon
#bitbucket-icon
#square(size: 1em, fill: color-darkgray) #square(size: 1em, fill: color-darkgray)
#square(size: 1em, fill: color-darknight) #square(size: 1em, fill: color-darknight)
#square(size: 1em, fill: color-gray) #square(size: 1em, fill: color-gray)
#square(size: 1em, fill: default-accent-color) #square(size: 1em, fill: default-accent-color)
#square(size: 1em, fill: default-location-color) #square(size: 1em, fill: default-location-color)