Skip to content

Commit

Permalink
moderner-cv:0.1.0 (#783)
Browse files Browse the repository at this point in the history
  • Loading branch information
pavelzw committed Jul 3, 2024
1 parent 9321359 commit a8ee2bd
Show file tree
Hide file tree
Showing 6 changed files with 317 additions and 0 deletions.
21 changes: 21 additions & 0 deletions packages/preview/moderner-cv/0.1.0/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2024 Pavel Zwerschke

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
46 changes: 46 additions & 0 deletions packages/preview/moderner-cv/0.1.0/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# moderner-cv

This is a typst adaptation of LaTeX's [moderncv](https://github.com/moderncv/moderncv), a modern curriculum vitae class.

## Requirements

This template uses FontAwesome icons via the [fontawesome typst package](https://typst.app/universe/package/fontawesome).
In order to properly use it, you need to have fontawesome installed on your system or have typst configured (via `--font-path`) to use the fontawesome font files.
You can download fontawesome [here](https://fontawesome.com/download).

## Usage

```typst
#import "@preview/moderner-cv:0.1.0": *
#show: moderner-cv.with(
name: "Jane Doe",
lang: "en",
social: (
email: "[email protected]",
github: "jane-doe",
linkedin: "jane-doe",
),
)
// ...
```

## Examples

![Jane Doe's CV](assets/example.png)

## Building and Testing Locally

To build and test the template locally, you can run `pixi run watch` in the root of this repository.
Please ensure to have linked this package to your local typst packages, see [here](https://github.com/typst/packages#local-packages):

```bash
# linux
mkdir -p ~/.local/share/typst/packages/preview/moderner-cv
ln -s $(pwd) ~/.local/share/typst/packages/preview/moderner-cv/0.1.0

# macos
mkdir -p ~/Library/Application\ Support/typst/packages/preview/moderner-cv
ln -s $(pwd) ~/Library/Application\ Support/typst/packages/preview/moderner-cv/0.1.0
```
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
171 changes: 171 additions & 0 deletions packages/preview/moderner-cv/0.1.0/lib.typ
Original file line number Diff line number Diff line change
@@ -0,0 +1,171 @@
#import "@preview/fontawesome:0.2.1": *

#let _cv-line(left, right, ..args) = {
set block(below: 0pt)
table(
columns: (1fr, 5fr),
stroke: none,
..args.named(),
left,
right,
)
}
#let moderncv-blue = rgb("#3973AF")

#let _header(
title: [],
subtitle: [],
socials: (:),
) = {
let titleStack = stack(
dir: ttb,
spacing: 1em,
text(size: 30pt, title),
text(size: 20pt, subtitle),
)

let social(icon, link_prefix, username) = [
#fa-icon(icon) #link(link_prefix + username)[#username]
]

let socialsList = ()
if "phone" in socials {
socialsList.push(social("phone", "tel:", socials.phone))
}
if "email" in socials {
socialsList.push(social("envelope", "mailto:", socials.email))
}
if "github" in socials {
socialsList.push(social("github", "https://github.com/", socials.github))
}
if "linkedin" in socials {
socialsList.push(
social("linkedin", "https://linkedin.com/in/", socials.linkedin),
)
}

let socialStack = stack(
dir: ttb,
spacing: 0.5em,
..socialsList,
)

stack(
dir: ltr,
titleStack,
align(
right + top,
socialStack,
),
)
}

#let moderner-cv(
name: [],
subtitle: [CV],
social: (:),
color: moderncv-blue,
lang: "en",
font: ("New Computer Modern"),
show-footer: true,
body,
) = [
#set page(
paper: "a4",
margin: (
top: 10mm,
bottom: 15mm,
left: 15mm,
right: 15mm,
),
)
#set text(
font: font,
lang: lang,
)

#show heading: it => {
set text(weight: "regular")
set text(color)
set block(above: 0pt)
_cv-line(
[],
[#it.body],
)
}
#show heading.where(level: 1): it => {
set text(weight: "regular")
set text(color)
_cv-line(
align: horizon,
[#box(fill: color, width: 28mm, height: 0.25em)],
[#it.body],
)
}

#_header(title: name, subtitle: subtitle, socials: social)

#body

#if show-footer [
#v(1fr, weak: false)
#name\
#datetime.today().display("[month repr:long] [day], [year]")
]
]
#let cv-line(left-side, right-side) = {
_cv-line(
align(right, left-side),
par(right-side, justify: true),
)
}
#let cv-entry(
date: [],
title: [],
employer: [],
..description,
) = {
let elements = (
strong(title),
emph(employer),
..description.pos(),
)
cv-line(
date,
elements.join(", "),
)
}
#let cv-language(name: [], level: [], comment: []) = {
_cv-line(
align(right, name),
stack(dir: ltr, level, align(right, emph(comment))),
)
}
#let cv-double-item(left-1, right-1, left-2, right-2) = {
set block(below: 0pt)
table(
columns: (1fr, 2fr, 1fr, 2fr),
stroke: none,
align(right, left-1), right-1, align(right, left-2), right-2,
)
}
#let cv-list-item(item) = {
_cv-line(
[],
list(item),
)
}
#let cv-list-double-item(item1, item2) = {
set block(below: 0pt)
table(
columns: (1fr, 2.5fr, 2.5fr),
stroke: none,
[], list(item1), list(item2),
)
}
60 changes: 60 additions & 0 deletions packages/preview/moderner-cv/0.1.0/template/example.typ
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
#import "@preview/moderner-cv:0.1.0": *

#show: moderner-cv.with(
name: "Jane Doe",
lang: "en",
social: (
email: "[email protected]",
github: "jane-doe",
linkedin: "jane-doe",
),
)

= Education

#cv-entry(
date: [2021 -- 2024],
title: [M.Sc. Ophiology],
employer: [Cobra Creek College],
)[3.9/4.0]
#cv-entry(
date: [2018 -- 2021],
title: [B.Sc. Herpetology],
employer: [Serpentis University],
)[4.0/4.0]

= Experience

#cv-entry(
date: [4/2022 -- 7/2023],
employer: [The Snake Company],
title: [Snake Specialist],
[#linebreak()#text(10pt, lorem(30))],
)
#cv-entry(
date: [4/2022 -- 7/2023],
employer: [Viper Ventures],
title: [Working Student],
[#linebreak()#text(10pt, lorem(30))],
)

= Programming Skills

#cv-double-item[
Languages
][
Python
][
Technologies
][
Conda, Boa, Rattler-build
]

= Languages

#cv-double-item[English][Native][French][Fluent]
#cv-line[Dutch][Advanced]

= Hobbies

#cv-list-double-item[Snake Spotting][Collecting Venom]
19 changes: 19 additions & 0 deletions packages/preview/moderner-cv/0.1.0/typst.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
[package]
name = "moderner-cv"
version = "0.1.0"
compiler = "0.11.1"
entrypoint = "lib.typ"
authors = ["Pavel Zwerschke <@pavelzw>"]
license = "MIT"
description = "A resume template based on the moderncv LaTeX package."
keywords = ["CV", "Curriculum Vitae", "Resume", "Minimalistic", "Professional", "Modern"]
categories = ["cv"]
disciplines = []
exclude = ["pixi.*", ".pixi"]
homepage = "https://github.com/pavelzw/moderner-cv"
repository = "https://github.com/pavelzw/moderner-cv"

[template]
path = "template"
entrypoint = "example.typ"
thumbnail = "assets/example.png"

0 comments on commit a8ee2bd

Please sign in to comment.