Initial commit

This commit is contained in:
Agatha Lovelace 2023-12-13 12:55:12 +01:00
commit 4e058e1ac4
Signed by: sorceress
GPG Key ID: 01D0B3AB10CED4F8
8 changed files with 153 additions and 0 deletions

1
.envrc Normal file
View File

@ -0,0 +1 @@
use flake

4
.gitignore vendored Normal file
View File

@ -0,0 +1,4 @@
.direnv
/*.typ
templates/self.typ
*.pdf

8
.helix/languages.toml Normal file
View File

@ -0,0 +1,8 @@
[language-server.typst-lsp]
command = "typst-lsp"
config = { exportPdf = "never" }
[[language]]
name = "typst"
auto-format = true
formatter = { command = "typstfmt" }

26
flake.lock Normal file
View File

@ -0,0 +1,26 @@
{
"nodes": {
"nixpkgs": {
"locked": {
"lastModified": 1702151865,
"narHash": "sha256-9VAt19t6yQa7pHZLDbil/QctAgVsA66DLnzdRGqDisg=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "666fc80e7b2afb570462423cb0e1cf1a3a34fedd",
"type": "github"
},
"original": {
"id": "nixpkgs",
"ref": "nixos-unstable",
"type": "indirect"
}
},
"root": {
"inputs": {
"nixpkgs": "nixpkgs"
}
}
},
"root": "root",
"version": 7
}

13
flake.nix Normal file
View File

@ -0,0 +1,13 @@
{
description = "Typst dev environment";
inputs = { nixpkgs.url = "nixpkgs/nixos-unstable"; };
outputs = { self, nixpkgs }: {
devShells."x86_64-linux".default =
let pkgs = import nixpkgs { system = "x86_64-linux"; };
in pkgs.mkShell {
buildInputs = with pkgs; [ typst typst-lsp typst-fmt ];
};
};
}

2
justfile Normal file
View File

@ -0,0 +1,2 @@
clean:
fd . --no-ignore -e pdf -x rm

80
templates/letter.typ Normal file
View File

@ -0,0 +1,80 @@
#let din5008(
returnaddr: none,
recipient: none,
recipientnote: none,
information: none,
header: none,
footer: none,
footermargin: none,
body,
) = {
let combinedfooter = stack(dir: ttb, spacing: 1in / 6, align(right, locate(loc => [
Seite #counter(page).display() von #counter(page).final(loc).at(0)
])), footer)
set page(
paper: "a4",
footer: combinedfooter,
footer-descent: 1in / 6,
header: header,
margin: (
top: 27mm,
left: 25mm,
right: 20mm,
bottom: if footermargin != none { footermargin } else { 35mm },
),
)
for item in (
(ref: top + left, dx: -25mm, dy: 60mm, len: 4mm),
(ref: top + right, dx: 20mm, dy: 60mm, len: 4mm),
(ref: bottom + left, dx: -25mm, dy: -80mm, len: 4mm),
(ref: bottom + right, dx: 20mm, dy: -80mm, len: 4mm),
(ref: top + left, dx: -25mm, dy: 121.5mm, len: 10mm),
) {
place(item.ref, dx: item.dx, dy: item.dy, line(length: item.len))
}
grid(
columns: 1,
rows: (60mm, auto),
gutter: 1in / 3,
rect(width: 100%, height: 100%, stroke: none, {
place(
top + left,
dx: 0mm,
dy: 0mm,
rect(height: 45mm, width: 80mm, stroke: none, grid(
columns: 1,
rows: (5mm, 12.7mm, 27.3mm),
text(8pt)[#returnaddr],
recipientnote,
recipient,
)),
)
place(
top + left,
dx: 100mm,
dy: 5mm,
rect(width: 75mm, stroke: none, information),
)
}),
body,
)
}
#let signature(image: none, width: 30%, name) = {
block(
width: width,
stack(
dir: ttb,
spacing: 5pt,
if image == none {
rect(stroke: (bottom: 1pt + black, rest: none), height: 20pt, width: 100%)
} else {
image
},
name,
),
)
}

19
templates/slides.typ Normal file
View File

@ -0,0 +1,19 @@
#import "@preview/polylux:0.3.1": *
#import "self.typ"
#let presentation(title: none, subtitle: none, authors: self.name, doc) = {
set page(paper: "presentation-16-9")
set text(size: 25pt, font: "Comic Sans MS")
if title != none [
#polylux-slide[
#set align(horizon + center)
= #title
=== #subtitle
#align(bottom)[#authors]
]
]
doc
}