Download src/blueprint/typst/lib.typ from zal-analytics-core/znote-data: direct link, hf CLI and curl.
- Browser
- Download file 2.95 kB
-
https://huggingface.co/datasets/zal-analytics-core/znote-data/resolve/main/src/blueprint/typst/lib.typ
- Command line
-
hf download hf://datasets/zal-analytics-core/znote-data/src/blueprint/typst/lib.typ
-
curl -L -o lib.typ https://huggingface.co/datasets/zal-analytics-core/znote-data/resolve/main/src/blueprint/typst/lib.typ
2.95 kB
| #let ink = rgb("#111827") | |
| #let accent = rgb("#0e7490") | |
| #let rule = rgb("#9ca3af") | |
| #let quiet = rgb("#56657a") | |
| #let sans = ("Segoe UI", "Helvetica Neue", "Arial", "Libertinus Serif") | |
| #let mono = ("Cascadia Mono", "Consolas", "DejaVu Sans Mono") | |
| #let today = datetime.today().display("[year]-[month]-[day]") | |
| #let tag(body) = text(font: mono, size: 7.5pt, fill: quiet, upper(body)) | |
| #let base(header-left, header-right, body) = { | |
| set text(font: sans, size: 10pt, fill: ink, lang: "en") | |
| set par(justify: true, leading: 0.68em, spacing: 1.15em) | |
| set page( | |
| paper: "a4", | |
| margin: (x: 2.2cm, top: 2.8cm, bottom: 2.4cm), | |
| header: { | |
| tag(header-left) | |
| h(1fr) | |
| tag(header-right) | |
| v(-0.7em) | |
| line(length: 100%, stroke: 0.5pt + rule) | |
| }, | |
| footer: context { | |
| line(length: 100%, stroke: 0.5pt + rule) | |
| v(-0.6em) | |
| h(1fr) | |
| tag(counter(page).display("1 of 1", both: true)) | |
| }, | |
| ) | |
| set heading(numbering: "1.1") | |
| set table(stroke: 0.5pt + rule, inset: 6pt) | |
| show heading: set text(fill: accent) | |
| show heading: set block(above: 1.5em, below: 0.8em) | |
| show raw: set text(font: mono) | |
| show table.cell.where(y: 0): strong | |
| body | |
| } | |
| #let title-block(title, ..fields) = { | |
| let cells = fields.pos().map(((label, value)) => [#tag(label) \ #value]) | |
| table( | |
| columns: (1fr,) * calc.max(cells.len(), 1), | |
| stroke: 0.8pt + ink, | |
| inset: 8pt, | |
| table.cell(colspan: calc.max(cells.len(), 1), text(size: 18pt, weight: "bold", title)), | |
| ..cells, | |
| ) | |
| v(1em) | |
| } | |
| #let requirement(id, body) = block( | |
| width: 100%, | |
| inset: (left: 10pt, y: 4pt), | |
| stroke: (left: 2pt + accent), | |
| [#text(font: mono, size: 9pt, weight: "bold", fill: accent, id) #h(0.6em) #body], | |
| ) | |
| #let note(body) = block(width: 100%, inset: 10pt, fill: rgb("#eef2f5"), stroke: 0.5pt + rule, body) | |
| #let result(status) = { | |
| let colour = if lower(status) == "pass" { rgb("#15803d") } else if lower(status) == "fail" { rgb("#b91c1c") } else { | |
| rgb("#b45309") | |
| } | |
| box(inset: (x: 5pt, y: 2pt), radius: 2pt, fill: colour, text(font: mono, size: 8pt, weight: "bold", fill: white, upper(status))) | |
| } | |
| #let specification(title: "Title", number: "DOC-0001", revision: "A", status: "Draft", author: none, date: today, body) = { | |
| show: base.with([#number · Rev #revision], title) | |
| title-block(title, ("Document", number), ("Revision", revision), ("Status", status), ("Author", author), ("Date", date)) | |
| outline(depth: 2) | |
| body | |
| } | |
| #let design(title: "Title", author: none, status: "Draft", reviewers: none, date: today, body) = { | |
| show: base.with([Design document · #status], title) | |
| title-block(title, ("Author", author), ("Reviewers", reviewers), ("Status", status), ("Date", date)) | |
| body | |
| } | |
| #let test-report(title: "Title", number: "TR-0001", tester: none, date: today, body) = { | |
| show: base.with([#number · Test report], title) | |
| title-block(title, ("Report", number), ("Tested by", tester), ("Date", date)) | |
| body | |
| } | |