Fix warnings when using typst 0.12.0 (#71)

* fixes for warnings with typst 0.12.0
* update tests for typst 0.12.0
* update github test workflow for typst 0.12
* chore: apply typst updates to test code
* chore: update compiler version in typst.toml
* chore: use the correct preview version in coverletter2
* chore: improve comments in coverletter template
* chore: update test references
* fix: issues with coverletter for typst `0.12.0`
* update test references with typst-test update

---------

Co-authored-by: Paul Tsouchlos <developer.paul.123@gmail.com>
This commit is contained in:
Jürgen Kleer
2024-10-22 13:39:01 +02:00
committed by GitHub
parent d12482c7fe
commit 4c417a7cbd
10 changed files with 67 additions and 77 deletions

View File

@@ -10,11 +10,11 @@ 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.11"] typst-version: ["0.12"]
# 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.11" - typst-version: "0.12"
doc: 1 doc: 1
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:

120
lib.typ
View File

@@ -82,7 +82,9 @@
#linguify("cover-letter", from: lang_data) #linguify("cover-letter", from: lang_data)
] ]
][ ][
#counter(page).display() #context {
counter(page).display()
}
] ]
} }
@@ -104,7 +106,9 @@
#linguify("resume", from: lang_data) #linguify("resume", from: lang_data)
] ]
][ ][
#counter(page).display() #context {
counter(page).display()
}
] ]
} }
@@ -115,7 +119,7 @@
/// -> none /// -> none
#let github-link(github-path) = { #let github-link(github-path) = {
set box(height: 11pt) set box(height: 11pt)
align(right + horizon)[ align(right + horizon)[
#fa-icon("github", fill: color-darkgray) #link( #fa-icon("github", fill: color-darkgray) #link(
"https://github.com/" + github-path, "https://github.com/" + github-path,
@@ -199,14 +203,14 @@
if type(accent-color) == "string" { if type(accent-color) == "string" {
accent-color = rgb(accent-color) accent-color = rgb(accent-color)
} }
let lang_data = toml("lang.toml") let lang_data = toml("lang.toml")
set document( set document(
author: author.firstname + " " + author.lastname, author: author.firstname + " " + author.lastname,
title: "resume", title: "resume",
) )
set text( set text(
font: font, font: font,
lang: language, lang: language,
@@ -214,7 +218,7 @@
fill: color-darkgray, fill: color-darkgray,
fallback: true, fallback: true,
) )
set page( set page(
paper: "a4", paper: "a4",
margin: (left: 15mm, right: 15mm, top: 10mm, bottom: 10mm), margin: (left: 15mm, right: 15mm, top: 10mm, bottom: 10mm),
@@ -226,37 +230,34 @@
)] else [], )] else [],
footer-descent: 0pt, footer-descent: 0pt,
) )
// set paragraph spacing // set paragraph spacing
show par: set block( set par(
above: 0.75em, spacing: 0.75em,
below: 0.75em, justify: true,
) )
set par(justify: true)
set heading( set heading(
numbering: none, numbering: none,
outlined: false, outlined: false,
) )
show heading.where(level: 1): it => [ show heading.where(level: 1): it => [
#set text( #set text(
size: 16pt, size: 16pt,
weight: "regular", weight: "regular",
) )
#set align(left)
#align(left)[ #set block(above: 1em)
#let color = if colored-headers { #let color = if colored-headers {
accent-color accent-color
} else { } else {
color-darkgray color-darkgray
} }
#text[#strong[#text(color)[#it.body.text]]] #text[#strong[#text(color)[#it.body.text]]]
#box(width: 1fr, line(length: 100%)) #box(width: 1fr, line(length: 100%))
]
] ]
show heading.where(level: 2): it => { show heading.where(level: 2): it => {
set text( set text(
color-darkgray, color-darkgray,
@@ -266,7 +267,7 @@
) )
it.body it.body
} }
show heading.where(level: 3): it => { show heading.where(level: 3): it => {
set text( set text(
size: 10pt, size: 10pt,
@@ -274,7 +275,7 @@
) )
smallcaps[#it.body] smallcaps[#it.body]
} }
let name = { let name = {
align(center)[ align(center)[
#pad(bottom: 5pt)[ #pad(bottom: 5pt)[
@@ -297,7 +298,7 @@
] ]
] ]
} }
let positions = { let positions = {
set text( set text(
accent-color, accent-color,
@@ -312,7 +313,7 @@
] ]
] ]
} }
let address = { let address = {
set text( set text(
size: 9pt, size: 9pt,
@@ -324,12 +325,12 @@
] ]
] ]
} }
let contacts = { let contacts = {
set box(height: 9pt) set box(height: 9pt)
let separator = box(width: 5pt) let separator = box(width: 5pt)
align(center)[ align(center)[
#set text( #set text(
size: 9pt, size: 9pt,
@@ -394,7 +395,7 @@
] ]
] ]
} }
name name
positions positions
address address
@@ -417,7 +418,7 @@
below: 1.25em, below: 1.25em,
) )
set par(leading: 0.65em) set par(leading: 0.65em)
block(above: 0.5em, below: 0.5em)[ block(above: 0.5em)[
#body #body
] ]
} }
@@ -453,7 +454,6 @@
] ]
] ]
] ]
} }
/// Show cumulative GPA. /// Show cumulative GPA.
@@ -483,7 +483,7 @@
#let resume-skill-item(category, items) = { #let resume-skill-item(category, items) = {
set block(below: 0.65em) set block(below: 0.65em)
set pad(top: 2pt) set pad(top: 2pt)
pad[ pad[
#grid( #grid(
columns: (20fr, 80fr), columns: (20fr, 80fr),
@@ -528,15 +528,15 @@
if type(accent-color) == "string" { if type(accent-color) == "string" {
accent-color = rgb(accent-color) accent-color = rgb(accent-color)
} }
// language data // language data
let lang_data = toml("lang.toml") let lang_data = toml("lang.toml")
set document( set document(
author: author.firstname + " " + author.lastname, author: author.firstname + " " + author.lastname,
title: "cover-letter", title: "cover-letter",
) )
set text( set text(
font: font, font: font,
lang: language, lang: language,
@@ -544,7 +544,7 @@
fill: color-darkgray, fill: color-darkgray,
fallback: true, fallback: true,
) )
set page( set page(
paper: "a4", paper: "a4",
margin: (left: 15mm, right: 15mm, top: 10mm, bottom: 10mm), margin: (left: 15mm, right: 15mm, top: 10mm, bottom: 10mm),
@@ -556,19 +556,15 @@
)] else [], )] else [],
footer-descent: 0pt, footer-descent: 0pt,
) )
// set paragraph spacing // set paragraph spacing
show par: set block( set par(spacing: 0.75em, justify: true)
above: 0.75em,
below: 0.75em,
)
set par(justify: true)
set heading( set heading(
numbering: none, numbering: none,
outlined: false, outlined: false,
) )
show heading: it => [ show heading: it => [
#set block( #set block(
above: 1em, above: 1em,
@@ -578,13 +574,13 @@
size: 16pt, size: 16pt,
weight: "regular", weight: "regular",
) )
#align(left)[ #align(left)[
#text[#strong[#text(accent-color)[#it.body.text]]] #text[#strong[#text(accent-color)[#it.body.text]]]
#box(width: 1fr, line(length: 100%)) #box(width: 1fr, line(length: 100%))
] ]
] ]
let name = { let name = {
align(right)[ align(right)[
#pad(bottom: 5pt)[ #pad(bottom: 5pt)[
@@ -603,12 +599,12 @@
#text(accent-color, weight: "thin")[#author.firstname] #text(accent-color, weight: "thin")[#author.firstname]
#text(weight: "bold")[#author.lastname] #text(weight: "bold")[#author.lastname]
] ]
] ]
] ]
] ]
} }
let positions = { let positions = {
set text( set text(
accent-color, accent-color,
@@ -623,7 +619,7 @@
] ]
] ]
} }
let address = { let address = {
set text( set text(
size: 9pt, size: 9pt,
@@ -636,12 +632,12 @@
] ]
] ]
} }
let contacts = { let contacts = {
set box(height: 9pt) set box(height: 9pt)
let separator = [#box(sym.bar.v)] let separator = [#box(sym.bar.v)]
align(right)[ align(right)[
#set text( #set text(
size: 8pt, size: 8pt,
@@ -689,7 +685,7 @@
] ]
] ]
} }
let letter-heading = { let letter-heading = {
grid( grid(
columns: (1fr, 2fr), columns: (1fr, 2fr),
@@ -712,7 +708,7 @@
], ],
) )
} }
let letter-conclusion = { let letter-conclusion = {
align(bottom)[ align(bottom)[
#pad(bottom: 2em)[ #pad(bottom: 2em)[
@@ -728,7 +724,7 @@
] ]
] ]
} }
// actual content // actual content
letter-heading letter-heading
body body
@@ -750,7 +746,7 @@
][ ][
#text(weight: "light", style: "italic", size: 9pt)[#date] #text(weight: "light", style: "italic", size: 9pt)[#date]
] ]
#pad(top: 0.65em, bottom: 0.65em)[ #pad(top: 0.65em, bottom: 0.65em)[
#text(weight: "regular", fill: color-gray, size: 9pt)[ #text(weight: "regular", fill: color-gray, size: 9pt)[
#smallcaps[#entity-info.name] \ #smallcaps[#entity-info.name] \
@@ -767,7 +763,7 @@
/// - dear (string): optional field for redefining the "dear" variable /// - dear (string): optional field for redefining the "dear" variable
#let letter-heading(job-position: "", addressee: "", dear: "") = { #let letter-heading(job-position: "", addressee: "", dear: "") = {
let lang_data = toml("lang.toml") let lang_data = toml("lang.toml")
// 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)[Job Application for #job-position] #text(weight: "bold", size: 12pt)[Job Application for #job-position]

0
scripts/uninstall Normal file → Executable file
View File

View File

@@ -19,7 +19,9 @@
profile-picture: image("./profile.png"), profile-picture: image("./profile.png"),
language: "en", language: "en",
font: "Times New Roman", font: "Times New Roman",
// show-footer: false, // Uncomment to hide footer // Remove the following line to show the footer
// Or set the value to `true`
show-footer: false,
) )
#hiring-entity-info(entity-info: ( #hiring-entity-info(entity-info: (

View File

@@ -1,4 +1,4 @@
#import "@preview/modern-cv:0.5.0": * #import "@preview/modern-cv:0.7.0": *
#show: coverletter.with( #show: coverletter.with(
author: ( author: (

Binary file not shown.

Before

Width:  |  Height:  |  Size: 112 KiB

After

Width:  |  Height:  |  Size: 32 KiB

View File

@@ -17,11 +17,7 @@
) )
// set paragraph spacing // set paragraph spacing
#show par: set block( #set par(spacing: 0.75em, justify: true)
above: 0.75em,
below: 0.75em,
)
#set par(justify: true)
#set heading( #set heading(
numbering: none, numbering: none,

Binary file not shown.

Before

Width:  |  Height:  |  Size: 91 KiB

After

Width:  |  Height:  |  Size: 24 KiB

View File

@@ -17,11 +17,7 @@
) )
// set paragraph spacing // set paragraph spacing
#show par: set block( #set par(spacing: 0.75em, justify: true)
above: 0.75em,
below: 0.75em,
)
#set par(justify: true)
#set heading( #set heading(
numbering: none, numbering: none,

View File

@@ -1,7 +1,7 @@
[package] [package]
name = "modern-cv" name = "modern-cv"
version = "0.7.0" version = "0.7.0"
compiler = "0.11.0" compiler = "0.12.0"
entrypoint = "lib.typ" entrypoint = "lib.typ"
authors = ["Paul Tsouchlos <https://github.com/DeveloperPaul123>"] authors = ["Paul Tsouchlos <https://github.com/DeveloperPaul123>"]
license = "MIT" license = "MIT"