Initial commit

This commit is contained in:
Thomas Forgione 2024-03-06 11:02:01 +01:00
commit 77fd72794a
4 changed files with 79 additions and 0 deletions

2
Makefile Normal file
View File

@ -0,0 +1,2 @@
all:
mkdir -p build && typst compile main.typ build/main.pdf

BIN
build/main.pdf Normal file

Binary file not shown.

33
main.typ Normal file
View File

@ -0,0 +1,33 @@
#import "template.typ"
#show: doc => template.apply(doc)
#grid(
columns: (1fr, 1fr),
[
= Bash
```bash
~% FILE="example.tar.gz"
~% echo "${FILE%%.*}"
example
~% echo "${FILE%.*}"
example.tar
~% echo "${FILE#*.}"
tar.gz
~% echo "${FILE##*.}"
gz
```
= Screen
```sh
screen -S name # Créer un screen nommé
screen -ls # Lister les screens
screen -r name # Rattacher un screen
# <Ctrl+A> <d> # Se détacher du screen actuel
```
],
[],
)

44
template.typ Normal file
View File

@ -0,0 +1,44 @@
#let apply(doc) = {
set page(
paper: "a4",
flipped: true,
numbering: none,
margin: (x: 2.5em, y: 1em)
)
// Code formatting
show raw.where(block: true): it => {
set par(justify: false)
let split = it.text.split("\n")
let len = split.len()
grid(
columns: (100%, 100%),
column-gutter: -100%,
block(width: 100%, inset: 1em, for (i, line) in split.enumerate() {
box(width: 0pt, align(right, str(i + 1) + h(2em)))
hide(line)
linebreak()
}),
block(radius: 1em, fill: luma(246), width: 100%, inset: 1em, it),
)
}
show link: content => {
set text(fill: blue)
content
}
show cite: content => {
set text(fill: blue)
content
}
show ref: content => {
set text(fill: blue)
content
}
set heading(numbering: "1.1")
doc
}