commit 77fd72794ac53dd940eb9b516c23a04f933366e4 Author: Thomas Forgione Date: Wed Mar 6 11:02:01 2024 +0100 Initial commit diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..c5fe26d --- /dev/null +++ b/Makefile @@ -0,0 +1,2 @@ +all: + mkdir -p build && typst compile main.typ build/main.pdf diff --git a/build/main.pdf b/build/main.pdf new file mode 100644 index 0000000..6c90f3d Binary files /dev/null and b/build/main.pdf differ diff --git a/main.typ b/main.typ new file mode 100644 index 0000000..eeb2281 --- /dev/null +++ b/main.typ @@ -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 + # # Se détacher du screen actuel + ``` + ], + [], +) diff --git a/template.typ b/template.typ new file mode 100644 index 0000000..721f42e --- /dev/null +++ b/template.typ @@ -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 +}