Skip to content

Commit

Permalink
Create typst package
Browse files Browse the repository at this point in the history
  • Loading branch information
pavelzw committed Jul 2, 2024
1 parent a1e21dd commit b919a5a
Show file tree
Hide file tree
Showing 8 changed files with 103 additions and 4 deletions.
Binary file added .github/assets/example.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 14 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,17 @@ jobs:
uses: prefix-dev/setup-pixi@ba3bb36eb2066252b2363392b7739741bb777659
- name: pre-commit
run: pixi run pre-commit-run --color=always --show-diff-on-failure

compile:
runs-on: ubuntu-latest
steps:
- name: Checkout branch
uses: actions/checkout@v4
- name: Set up pixi
uses: prefix-dev/setup-pixi@ba3bb36eb2066252b2363392b7739741bb777659
- name: Link packages
run: |
mkdir -p ~/.local/share/typst/packages/preview/moderner-cv
ln -s $(pwd) ~/.local/share/typst/packages/preview/moderner-cv/0.1.0
- name: compile
run: pixi run compile
21 changes: 21 additions & 0 deletions 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 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 "moderner-cv.typ": *
#show: moderner-cv.with(
name: "Jane Doe",
lang: "en",
social: (
email: "[email protected]",
github: "jane-doe",
linkedin: "jane-doe",
),
)
// ...
```

## Examples

![Jane Doe's CV](.github/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
```
1 change: 0 additions & 1 deletion moderner-cv.typ → lib.typ
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,6 @@
)
}
// TODO: adjust list style
#let cv-list-item(item) = {
_cv-line(
[],
Expand Down
4 changes: 2 additions & 2 deletions pixi.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ channels = ["conda-forge"]
platforms = ["osx-arm64", "linux-64", "win-64"]

[tasks]
watch = "typst watch --font-path=fonts example.typ"
compile = "typst compile --font-path=fonts example.typ"
watch = "typst watch --font-path=fonts template/example.typ"
compile = "typst compile --font-path=fonts template/example.typ"
pre-commit-run = "pre-commit run -a"

[dependencies]
Expand Down
2 changes: 1 addition & 1 deletion example.typ → template/example.typ
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#import "moderner-cv.typ": *
#import "@preview/moderner-cv:0.1.0": *

#show: moderner-cv.with(
name: "Jane Doe",
Expand Down
19 changes: 19 additions & 0 deletions 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 = ".github/assets/example.png"

0 comments on commit b919a5a

Please sign in to comment.