diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 2f1ad46..d276524 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -14,7 +14,7 @@ env: jobs: release: - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 steps: - name: Checkout uses: actions/checkout@v4 diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index eb0f818..18166c7 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -10,13 +10,13 @@ jobs: strategy: matrix: # 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 latest one is enough include: - - typst-version: "0.12" + - typst-version: "0.13" doc: 1 - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 steps: - name: Checkout uses: actions/checkout@v4 @@ -37,12 +37,10 @@ jobs: with: crate: just - - name: Install typst-test from github + - name: Install tytanic from github uses: baptiste0928/cargo-install@v3 with: - crate: typst-test - git: https://github.com/tingerrr/typst-test.git - tag: ci-semi-stable + crate: tytanic - name: Setup typst uses: typst-community/setup-typst@v3 @@ -55,6 +53,7 @@ jobs: sudo apt-get install fonts-roboto ./scripts/install-fontawesome ./scripts/install-source-sans + typst fonts - name: Install locally run: just install diff --git a/Justfile b/Justfile index 882c22b..5df58d2 100644 --- a/Justfile +++ b/Justfile @@ -7,39 +7,51 @@ default: @just --list --unsorted # generate manual +[doc('Generate package documentation')] +[group('package')] doc: typst compile docs/manual.typ docs/manual.pdf -# run test suite -test *args: - typst-test run {{ args }} +[doc('Run test suite. Requires tytanic.')] +[group('dev')] +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: - 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: ./scripts/package "{{target}}" -# install the library with the "@local" prefix +[doc('Install the library with the "@local" prefix')] +[group('dev')] 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") [private] remove target: ./scripts/uninstall "{{target}}" -# uninstalls the library from the "@local" prefix +[doc('Uninstall the library from the "@local" prefix')] +[group('dev')] 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") +[doc('Format the source code. Requires typstyle.')] +[group('dev')] format: ./scripts/format -# run ci suite +[doc('Run ci suite')] +[group('dev')] ci: test doc diff --git a/lib.typ b/lib.typ index 59a7214..2f938dc 100644 --- a/lib.typ +++ b/lib.typ @@ -1,5 +1,5 @@ #import "@preview/fontawesome:0.5.0": * -#import "@preview/linguify:0.4.1": * +#import "@preview/linguify:0.4.2": * // const color #let color-darknight = rgb("#131A28") @@ -230,7 +230,7 @@ } let lang_data = toml("lang.toml") - + show: body => context { set document( author: author.firstname + " " + author.lastname, @@ -238,7 +238,7 @@ ) body } - + set text( font: font, lang: language, @@ -464,9 +464,8 @@ address contacts } - + body - } /// The base item for resume entries. @@ -618,15 +617,19 @@ if closing == none { closing = default-closing(lang_data) } - + show: body => context { set document( 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 } - + set text( font: font, lang: language, @@ -731,9 +734,9 @@ let contacts = { set box(height: 9pt) - let separator = [ #box(sym.bar.v) ] + let separator = [ #box(sym.bar.v) ] let author_list = () - + if ("phone" in author) { author_list.push[ #phone-icon @@ -772,8 +775,8 @@ #box[#link(author.website)[#author.website]] ] } - - + + align(right)[ #set text( size: 8pt, @@ -862,7 +865,10 @@ // TODO: Make this adaptable to content 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)[ #text(weight: "light", fill: color-gray)[ diff --git a/tests/resume/test.typ b/tests/resume/test.typ index c2d9d55..a7659fe 100644 --- a/tests/resume/test.typ +++ b/tests/resume/test.typ @@ -1,7 +1,7 @@ #import "@local/modern-cv:0.8.0": * // setup the document like we do for the resume -#let font = ("Source Sans Pro", "Source Sans 3") +#let font = ("Source Sans 3") #set text( font: font, size: 11pt, diff --git a/tests/utilities/ref/1.png b/tests/utilities/ref/1.png index 13ab133..26160aa 100644 Binary files a/tests/utilities/ref/1.png and b/tests/utilities/ref/1.png differ diff --git a/tests/utilities/test.typ b/tests/utilities/test.typ index d8a7828..25db408 100644 --- a/tests/utilities/test.typ +++ b/tests/utilities/test.typ @@ -1,7 +1,7 @@ #import "@local/modern-cv:0.8.0": * // setup the document like we do for the resume -#let font = ("Source Sans Pro", "Source Sans 3") +#let font = ("Source Sans 3") #set text( font: font, size: 11pt, @@ -80,9 +80,11 @@ #birth-icon #homepage-icon #website-icon +#gitlab-icon +#bitbucket-icon #square(size: 1em, fill: color-darkgray) #square(size: 1em, fill: color-darknight) #square(size: 1em, fill: color-gray) #square(size: 1em, fill: default-accent-color) -#square(size: 1em, fill: default-location-color) \ No newline at end of file +#square(size: 1em, fill: default-location-color)