summary refs log tree commit diff stats
path: root/mysql-php/tpl.typ
diff options
context:
space:
mode:
authorSudipto Mallick <>2024-01-02 03:38:10 +0000
committerSudipto Mallick <>2024-01-02 03:38:10 +0000
commit7451edff7692e86c5238ff7bc6659825e242a84e (patch)
tree830fe25caf403869fe77df83bc44822ea6f5f11d /mysql-php/tpl.typ
parenta70e0a59817ce06a3dd23b3750ae16ee6660deaf (diff)
downloadzadania-7451edff7692e86c5238ff7bc6659825e242a84e.tar.gz
Quick backup, need to be rewritten
Diffstat (limited to 'mysql-php/tpl.typ')
-rw-r--r--mysql-php/tpl.typ53
1 files changed, 53 insertions, 0 deletions
diff --git a/mysql-php/tpl.typ b/mysql-php/tpl.typ
new file mode 100644
index 0000000..1179925
--- /dev/null
+++ b/mysql-php/tpl.typ
@@ -0,0 +1,53 @@
+#import "@preview/codelst:1.0.0": sourcefile
+#let hlfile(filename) = sourcefile(read(filename), file: filename)
+#let apply(body) = {
+  let body-font-settings = (font: "Nunito Sans 10pt", size: 12pt, stretch: 75%)
+//  let body-font-settings = (font: "Hanken Grotesk", size: 12pt, stretch: 75%)
+  let page-margin = (left: 0.75in, right: 0.25in, top: 0.5in, bottom: 0.25in)
+  let margin = (left: 0.75in, right: 0.25in, top: 2em, bottom: 2em)
+  let page-frame-thickness = 1.5pt
+  set page(
+    margin: (..page-margin, bottom: margin.bottom + 2em),
+    numbering: "1",
+    background: align(top + start, pad(..margin, rect(width: 100%, height: 100%, stroke: page-frame-thickness + gray))),
+    footer: locate(loc => align(center, move(dy: -margin.bottom + 1em, text(..body-font-settings, size: 9pt, counter(page).display(loc.page-numbering())))))
+  )
+  show: block.with(breakable: true, width: 100%, inset: page-frame-thickness + 1em)
+  
+  set text(..body-font-settings)
+
+  let code-color = rgb("#f4f4f4")
+//  show raw: set text(font: "CommitMono", size: 1.1em)
+//  show raw: set text(font: "Source Code Pro", size: 1.1em)
+  show raw: set text(font: "Iosevka Fixed", size: 10pt)
+  show raw.where(block: false): box.with(
+    fill: code-color,
+    inset: (x: 3pt, y: 0pt),
+    outset: (y: 3pt),
+    radius: 2pt,
+  )
+  show raw.where(block: true): block.with(
+    fill: code-color,
+    inset: 10pt,
+    radius: 4pt,
+    width: 100%,
+  )
+  show raw.where(block: true): it => align(left, it)
+  set raw(theme: "vendor/gr.tmTheme")
+  set par(leading: 0.6em)
+  body
+}
+
+#let assignment(number, description) = align(center, [
+= #text(weight: 600, [Assignment #number])
+== #text(weight: 500, [Program description:]) #text(weight: 400, description)
+])
+#let objective(body) = align(center, [*Objective*: #body])
+#let oset(kind) = block(spacing: 0.6em, [===== #h(1em) #kind])
+
+#let scos(n, obody) = {
+    [=== Source Code]
+    hlfile("/code/a" + str(n) + ".php")
+    [=== Output]
+    obody
+}