Skip to content

Commit

Permalink
Fix warnings when using typst 0.12.0 (#71)
Browse files Browse the repository at this point in the history
* 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 <[email protected]>
  • Loading branch information
bluen and DeveloperPaul123 authored Oct 22, 2024
1 parent d12482c commit 4c417a7
Show file tree
Hide file tree
Showing 10 changed files with 67 additions and 77 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ jobs:
strategy:
matrix:
# 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 latest one is enough
include:
- typst-version: "0.11"
- typst-version: "0.12"
doc: 1
runs-on: ubuntu-latest
steps:
Expand Down
120 changes: 58 additions & 62 deletions lib.typ
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,9 @@
#linguify("cover-letter", from: lang_data)
]
][
#counter(page).display()
#context {
counter(page).display()
}
]
}

Expand All @@ -104,7 +106,9 @@
#linguify("resume", from: lang_data)
]
][
#counter(page).display()
#context {
counter(page).display()
}
]
}

Expand All @@ -115,7 +119,7 @@
/// -> none
#let github-link(github-path) = {
set box(height: 11pt)

align(right + horizon)[
#fa-icon("github", fill: color-darkgray) #link(
"https://github.com/" + github-path,
Expand Down Expand Up @@ -199,22 +203,22 @@
if type(accent-color) == "string" {
accent-color = rgb(accent-color)
}

let lang_data = toml("lang.toml")

set document(
author: author.firstname + " " + author.lastname,
title: "resume",
)

set text(
font: font,
lang: language,
size: 11pt,
fill: color-darkgray,
fallback: true,
)

set page(
paper: "a4",
margin: (left: 15mm, right: 15mm, top: 10mm, bottom: 10mm),
Expand All @@ -226,37 +230,34 @@
)] else [],
footer-descent: 0pt,
)

// set paragraph spacing
show par: set block(
above: 0.75em,
below: 0.75em,
set par(
spacing: 0.75em,
justify: true,
)
set par(justify: true)


set heading(
numbering: none,
outlined: false,
)

show heading.where(level: 1): it => [
#set text(
size: 16pt,
weight: "regular",
)

#align(left)[
#let color = if colored-headers {
accent-color
} else {
color-darkgray
}
#text[#strong[#text(color)[#it.body.text]]]
#box(width: 1fr, line(length: 100%))
]

#set align(left)
#set block(above: 1em)
#let color = if colored-headers {
accent-color
} else {
color-darkgray
}
#text[#strong[#text(color)[#it.body.text]]]
#box(width: 1fr, line(length: 100%))
]

show heading.where(level: 2): it => {
set text(
color-darkgray,
Expand All @@ -266,15 +267,15 @@
)
it.body
}

show heading.where(level: 3): it => {
set text(
size: 10pt,
weight: "regular",
)
smallcaps[#it.body]
}

let name = {
align(center)[
#pad(bottom: 5pt)[
Expand All @@ -297,7 +298,7 @@
]
]
}

let positions = {
set text(
accent-color,
Expand All @@ -312,7 +313,7 @@
]
]
}

let address = {
set text(
size: 9pt,
Expand All @@ -324,12 +325,12 @@
]
]
}

let contacts = {
set box(height: 9pt)

let separator = box(width: 5pt)

align(center)[
#set text(
size: 9pt,
Expand Down Expand Up @@ -394,7 +395,7 @@
]
]
}

name
positions
address
Expand All @@ -417,7 +418,7 @@
below: 1.25em,
)
set par(leading: 0.65em)
block(above: 0.5em, below: 0.5em)[
block(above: 0.5em)[
#body
]
}
Expand Down Expand Up @@ -453,7 +454,6 @@
]
]
]

}

/// Show cumulative GPA.
Expand Down Expand Up @@ -483,7 +483,7 @@
#let resume-skill-item(category, items) = {
set block(below: 0.65em)
set pad(top: 2pt)

pad[
#grid(
columns: (20fr, 80fr),
Expand Down Expand Up @@ -528,23 +528,23 @@
if type(accent-color) == "string" {
accent-color = rgb(accent-color)
}

// language data
let lang_data = toml("lang.toml")

set document(
author: author.firstname + " " + author.lastname,
title: "cover-letter",
)

set text(
font: font,
lang: language,
size: 11pt,
fill: color-darkgray,
fallback: true,
)

set page(
paper: "a4",
margin: (left: 15mm, right: 15mm, top: 10mm, bottom: 10mm),
Expand All @@ -556,19 +556,15 @@
)] else [],
footer-descent: 0pt,
)

// set paragraph spacing
show par: set block(
above: 0.75em,
below: 0.75em,
)
set par(justify: true)

set par(spacing: 0.75em, justify: true)

set heading(
numbering: none,
outlined: false,
)

show heading: it => [
#set block(
above: 1em,
Expand All @@ -578,13 +574,13 @@
size: 16pt,
weight: "regular",
)

#align(left)[
#text[#strong[#text(accent-color)[#it.body.text]]]
#box(width: 1fr, line(length: 100%))
]
]

let name = {
align(right)[
#pad(bottom: 5pt)[
Expand All @@ -603,12 +599,12 @@
#text(accent-color, weight: "thin")[#author.firstname]
#text(weight: "bold")[#author.lastname]
]

]
]
]
}

let positions = {
set text(
accent-color,
Expand All @@ -623,7 +619,7 @@
]
]
}

let address = {
set text(
size: 9pt,
Expand All @@ -636,12 +632,12 @@
]
]
}

let contacts = {
set box(height: 9pt)

let separator = [#box(sym.bar.v)]

align(right)[
#set text(
size: 8pt,
Expand Down Expand Up @@ -689,7 +685,7 @@
]
]
}

let letter-heading = {
grid(
columns: (1fr, 2fr),
Expand All @@ -712,7 +708,7 @@
],
)
}

let letter-conclusion = {
align(bottom)[
#pad(bottom: 2em)[
Expand All @@ -728,7 +724,7 @@
]
]
}

// actual content
letter-heading
body
Expand All @@ -750,7 +746,7 @@
][
#text(weight: "light", style: "italic", size: 9pt)[#date]
]

#pad(top: 0.65em, bottom: 0.65em)[
#text(weight: "regular", fill: color-gray, size: 9pt)[
#smallcaps[#entity-info.name] \
Expand All @@ -767,7 +763,7 @@
/// - dear (string): optional field for redefining the "dear" variable
#let letter-heading(job-position: "", addressee: "", dear: "") = {
let lang_data = toml("lang.toml")

// TODO: Make this adaptable to content
underline(evade: false, stroke: 0.5pt, offset: 0.3em)[
#text(weight: "bold", size: 12pt)[Job Application for #job-position]
Expand Down
Empty file modified scripts/uninstall
100644 → 100755
Empty file.
4 changes: 3 additions & 1 deletion template/coverletter.typ
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@
profile-picture: image("./profile.png"),
language: "en",
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: (
Expand Down
2 changes: 1 addition & 1 deletion template/coverletter2.typ
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#import "@preview/modern-cv:0.5.0": *
#import "@preview/modern-cv:0.7.0": *

#show: coverletter.with(
author: (
Expand Down
Binary file modified tests/resume/ref/1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 1 addition & 5 deletions tests/resume/test.typ
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,7 @@
)

// set paragraph spacing
#show par: set block(
above: 0.75em,
below: 0.75em,
)
#set par(justify: true)
#set par(spacing: 0.75em, justify: true)

#set heading(
numbering: none,
Expand Down
Binary file modified tests/utilities/ref/1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 4c417a7

Please sign in to comment.