git-intro/definicije.typ

19 lines
1 KiB
Typst

#import "@preview/fletcher:0.5.8" as fletcher: diagram, node, edge
#import fletcher.shapes: house, chevron, pill, hexagon
#let commit-color = green
#let tag-color = orange
#let branch-color = purple
#let thin = 0.5pt;
#let thindotted = (thickness: thin, dash: "dotted");
#let thindashed = (thickness: thin, dash: "dashed");
#let commit-node(coord, hash, ..args) = node(
coord, raw(hash), shape: pill, fill: commit-color.lighten(50%), stroke: thin, ..args)
#let commit-object(coord, hash, name, ..args) = node(
coord, align(left, [#text(size: 8pt, gray.darken(50%), raw(hash))\ #name]),
corner-radius: 7pt, fill: commit-color.lighten(50%), stroke: none, ..args)
#let tree-object(coord, hash, content, ..args) = commit-object(coord, hash, content,
width: 2cm, fill: blue.lighten(50%), ..args)
#let file-object(coord, hash, name, ..args) = commit-object(coord, hash, name,
width: 2cm, fill: gray.lighten(50%), ..args)
#let git-object(hash, content) = table(columns: 1, [Zgoščena vrednost: #raw(hash)], raw(block:true, content))